Establish `api/` as the home for installed headers.
[alexxy/gromacs.git] / python_packaging / sample_restraint / src / cpp / CMakeLists.txt
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
3
4 # Create a shared object library for our restrained ensemble plugin.
5 add_library(gmxapi_extension_ensemblepotential STATIC
6             ensemblepotential.h
7             ensemblepotential.cpp
8             sessionresources.cpp)
9 set_target_properties(gmxapi_extension_ensemblepotential PROPERTIES POSITION_INDEPENDENT_CODE ON)
10
11 target_include_directories(gmxapi_extension_ensemblepotential PUBLIC
12                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
13                            $<INSTALL_INTERFACE:include>
14                            )
15 # RPATH management
16 # don't skip the full RPATH for the build tree
17 set_target_properties(gmxapi_extension_ensemblepotential PROPERTIES SKIP_BUILD_RPATH FALSE)
18
19 # (but later on when installing)
20 # If building with setuptools, CMake will not be performing the install
21 set_target_properties(gmxapi_extension_ensemblepotential PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
22
23 target_link_libraries(gmxapi_extension_ensemblepotential PUBLIC Gromacs::libgromacs Gromacs::gmxapi)