- avoid rebuilding FreeSASA at every build for no good reason (#7245)

- avoid prepending an #include to freesasa.h for no good reason

Co-authored-by: ptosco <paolo.tosco@novartis.com>
This commit is contained in:
Paolo Tosco
2024-03-16 07:35:08 +01:00
committed by GitHub
parent 3187496d59
commit 3353491ae6

View File

@@ -67,9 +67,11 @@ endif()
set (freesasa_h ${FREESASA_SRC_DIR}/src/freesasa.h)
file(READ ${freesasa_h} freesasa_h_data)
string(REGEX REPLACE "(#include <stdio.h>)" "\\1\n#include <RDGeneral/export.h>" freesasa_h_data "${freesasa_h_data}")
string(REGEX REPLACE "([^R][^D][^K][^I][^T][^_][^F][^R][^E][^E][^S][^A][^S][^A][^_][^C][^L][^I][^B][^_][^E][^X][^P][^O][^R][^T][^ ])(extern const)" "\\1RDKIT_FREESASA_CLIB_EXPORT \\2" freesasa_h_data "${freesasa_h_data}")
file(WRITE ${freesasa_h} "${freesasa_h_data}")
if (NOT freesasa_h_data MATCHES "RDGeneral/export")
string(REGEX REPLACE "(#include <stdio.h>)" "\\1\n#include <RDGeneral/export.h>" freesasa_h_data "${freesasa_h_data}")
string(REGEX REPLACE "([^R][^D][^K][^I][^T][^_][^F][^R][^E][^E][^S][^A][^S][^A][^_][^C][^L][^I][^B][^_][^E][^X][^P][^O][^R][^T][^ ])(extern const)" "\\1RDKIT_FREESASA_CLIB_EXPORT \\2" freesasa_h_data "${freesasa_h_data}")
file(WRITE ${freesasa_h} "${freesasa_h_data}")
endif()
add_definitions(-DUSE_THREADS=0)
add_definitions(-DUSE_JSON=0)