Create CMake targets for each of the modules.
[alexxy/gromacs.git] / src / gromacs / pbcutil / CMakeLists.txt
index 63a5dacfcb851d02010ba126a500d65bed456dc3..57ddbc882592f2ab2db913ab8c60d8a3860defc2 100644 (file)
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
+# Set up the module library
+add_library(pbcutil INTERFACE)
 file(GLOB PBCUTIL_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${PBCUTIL_SOURCES} PARENT_SCOPE)
 
+# Source files have the following dependencies on library infrastructure.
+#target_link_libraries(pbcutil PRIVATE
+#                      common
+#                      legacy_modules
+#)
+
+# Public interface for modules, including dependencies and interfaces
+#target_include_directories(pbcutil PUBLIC
+target_include_directories(pbcutil INTERFACE
+                           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+#target_link_libraries(pbcutil PUBLIC
+target_link_libraries(pbcutil INTERFACE
+                      legacy_api
+                      )
+
+# TODO: when pbcutil is an OBJECT target
+#target_link_libraries(pbcutil PUBLIC legacy_api)
+#target_link_libraries(pbcutil PRIVATE common)
+
+# Module dependencies
+# pbcutil interfaces convey transitive dependence on these modules.
+#target_link_libraries(pbcutil PUBLIC
+target_link_libraries(pbcutil INTERFACE
+                      utility
+                      )
+# Source files have the following private module dependencies.
+#target_link_libraries(pbcutil PRIVATE NOTHING)
+# TODO: Explicitly link specific modules.
+#target_link_libraries(pbcutil PRIVATE legacy_modules)
+
 if(GMX_INSTALL_LEGACY_API)
   install(FILES
           pbc.h