1 # Defines targets for the C++ restraints implemented here. These CMake targets are used by the
2 # unit tests and by the Python module target defined in ../pythonmodule/CMakeLists.txt
4 # These targets depend both on Gromacs::libgromacs and on Gromacs::gmxapi.
5 # These dependencies are likely to evolve.
6 # In particular, Gromacs::libgromacs has been deprecated for some time.
7 # https://gitlab.com/gromacs/gromacs/-/issues?label_name%5B%5D=API+restructuring
9 add_library(gmxapi_extension_resources STATIC
11 set_target_properties(gmxapi_extension_resources PROPERTIES POSITION_INDEPENDENT_CODE ON)
12 target_include_directories(gmxapi_extension_resources PUBLIC
13 ${CMAKE_CURRENT_SOURCE_DIR})
14 target_link_libraries(gmxapi_extension_resources PUBLIC
18 # Create an archive library for our restrained ensemble plugin.
19 add_library(gmxapi_extension_ensemblepotential STATIC
20 ensemblepotential.cpp)
21 set_target_properties(gmxapi_extension_ensemblepotential PROPERTIES POSITION_INDEPENDENT_CODE ON)
23 target_include_directories(gmxapi_extension_ensemblepotential PUBLIC
24 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
25 $<INSTALL_INTERFACE:include>
28 # don't skip the full RPATH for the build tree
29 set_target_properties(gmxapi_extension_ensemblepotential PROPERTIES SKIP_BUILD_RPATH FALSE)
31 # (but later on when installing)
32 # If building with setuptools, CMake will not be performing the install
33 set_target_properties(gmxapi_extension_ensemblepotential PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
35 target_link_libraries(gmxapi_extension_ensemblepotential PRIVATE
36 gmxapi_extension_resources
40 # Create an archive library for a test plugin.
41 add_library(gmxapi_extension_test STATIC
44 set_target_properties(gmxapi_extension_test PROPERTIES POSITION_INDEPENDENT_CODE ON)
46 target_include_directories(gmxapi_extension_test PUBLIC
47 ${CMAKE_CURRENT_SOURCE_DIR}
49 set_target_properties(gmxapi_extension_test PROPERTIES SKIP_BUILD_RPATH FALSE)
50 set_target_properties(gmxapi_extension_test PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
51 target_link_libraries(gmxapi_extension_test PRIVATE
52 gmxapi_extension_resources)
53 target_link_libraries(gmxapi_extension_test PUBLIC