1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
include_directories(${RDKit_ExternalDir})
include_directories(${RDKit_ExternalDir}/rapidjson-1.1.0/include)
if(RDK_BUILD_MINIMAL_LIB)
if(RDK_BUILD_FREETYPE_SUPPORT)
if( ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
set(USE_FLAGS "-s USE_FREETYPE=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${USE_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${USE_FLAGS}")
endif()
endif()
add_executable(RDKit_minimal jswrapper.cpp minilib.cpp)
target_link_libraries(RDKit_minimal MolInterchange_static Abbreviations_static
CIPLabeler_static MolDraw2D_static Depictor_static RDInchiLib_static
SubstructMatch_static SubstructLibrary_static FileParsers_static
SmilesParse_static GraphMol_static RDGeometryLib_static RDGeneral_static)
set_target_properties(RDKit_minimal PROPERTIES LINK_FLAGS "--bind")
endif(RDK_BUILD_MINIMAL_LIB)
if(RDK_BUILD_CFFI_LIB)
set(CMAKE_C_STANDARD 99)
if((NOT WIN32) OR (WIN32 AND RDK_INSTALL_DLLS_MSVC))
set(LIBS_TO_USE
MolStandardize_static DistGeomHelpers_static ForceFieldHelpers_static DistGeometry_static
ForceField_static Alignment_static
MolInterchange_static Abbreviations_static CIPLabeler_static
MolDraw2D_static Depictor_static
RDInchiLib_static SubstructMatch_static FileParsers_static
SmilesParse_static GraphMol_static RingDecomposerLib_static RDGeometryLib_static RDGeneral_static )
if(RDK_URF_LIBS)
list(APPEND LIBS_TO_USE RingDecomposerLib_static)
endif()
else()
set(LIBS_TO_USE
MolStandardize DistGeomHelpers ForceFieldHelpers DistGeometry
ForceField Alignment
MolInterchange Abbreviations CIPLabeler
MolDraw2D Depictor
RDInchiLib SubstructMatch FileParsers
SmilesParse GraphMol RingDecomposerLib RDGeometryLib RDGeneral )
if(RDK_URF_LIBS)
list(APPEND LIBS_TO_USE RingDecomposerLib)
endif()
endif()
add_library(rdkitcffi SHARED cffiwrapper.cpp)
target_link_libraries(rdkitcffi PUBLIC rdkit_base)
target_link_libraries(rdkitcffi PUBLIC ${LIBS_TO_USE})
INSTALL(TARGETS rdkitcffi EXPORT rdkit-targets
DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
COMPONENT runtime )
set_target_properties(rdkitcffi PROPERTIES
OUTPUT_NAME "rdkitcffi"
VERSION "${RDKit_ABI}.${RDKit_Year}.${RDKit_Month}.${RDKit_Revision}"
VERSION ${RDKit_VERSION}
SOVERSION ${RDKit_ABI} )
set_target_properties(rdkitcffi PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${RDK_ARCHIVE_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY ${RDK_RUNTIME_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY ${RDK_LIBRARY_OUTPUT_DIRECTORY})
if(MSVC OR WIN32)
set_target_properties(rdkitcffi PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif()
add_executable(cffi_test cffi_test.c)
target_link_libraries(cffi_test rdkitcffi)
#if(NOT MSVC)
# doesn't work as a test on windows because the DLL needs to be either in the PATH OR
# in the same dir as the executable
add_test(cffi_test ${EXECUTABLE_OUTPUT_PATH}/cffi_test)
#endif
endif(RDK_BUILD_CFFI_LIB)
|