Create CMake targets for each of the modules.
[alexxy/gromacs.git] / src / gromacs / mdrun / CMakeLists.txt
index cb714aff3de0a1a9ba8be7ea25c49bb626f4ce61..d5ddaf1a78b2c6fdc6706e0ff95c314c949b99a7 100644 (file)
@@ -32,6 +32,7 @@
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
+add_library(mdrun INTERFACE)
 gmx_add_libgromacs_sources(
     legacymdrunoptions.cpp
     legacysimulator.cpp
@@ -51,6 +52,38 @@ gmx_add_libgromacs_sources(
     tpi.cpp
     )
 
+# Source files have the following private module dependencies.
+target_link_libraries(mdrun PRIVATE
+#                      gmxlib
+#                      math
+#                      mdtypes
+#                      tng_io
+                      )
+
+# Public interface for modules, including dependencies and interfaces
+#target_include_directories(mdrun PUBLIC
+target_include_directories(mdrun INTERFACE
+                           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+#target_link_libraries(mdrun PUBLIC
+target_link_libraries(mdrun INTERFACE
+                      legacy_api
+                      )
+
+# TODO: when mdrun is an OBJECT target
+#target_link_libraries(mdrun PUBLIC legacy_api)
+#target_link_libraries(mdrun PRIVATE common)
+
+# Module dependencies
+# mdrun interfaces convey transitive dependence on these modules.
+#target_link_libraries(mdrun PUBLIC
+target_link_libraries(mdrun INTERFACE
+                      utility
+                      )
+# Source files have the following private module dependencies.
+#target_link_libraries(mdrun PRIVATE tng_io)
+# TODO: Explicitly link specific modules.
+#target_link_libraries(mdrun PRIVATE legacy_modules)
+
 # TODO: Find a home for this header and a scheme for installation.
 # This header straddles the installed libraries and is a transitive interface
 # from libgromacs to libgmxapi to libgmxapi clients. Near term efforts are