Create CMake targets for each of the modules.
[alexxy/gromacs.git] / src / gromacs / commandline / CMakeLists.txt
index 990e2f1233f6a283a19d0fdca5f2eaded86d699e..8af7264ba8dbc1d6e6050b43f810581f11b2a948 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.
 
+add_library(commandline INTERFACE)
 file(GLOB COMMANDLINE_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${COMMANDLINE_SOURCES} PARENT_SCOPE)
 
+# Source files have the following private module dependencies.
+target_link_libraries(commandline PRIVATE
+#                      gmxlib
+#                      math
+#                      mdtypes
+#                      tng_io
+                      )
+
+# Public interface for modules, including dependencies and interfaces
+#target_include_directories(commandline PUBLIC
+target_include_directories(commandline INTERFACE
+                           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+#target_link_libraries(commandline PUBLIC
+target_link_libraries(commandline INTERFACE
+                      legacy_api
+                      )
+
+# TODO: when commandline is an OBJECT target
+#target_link_libraries(commandline PUBLIC legacy_api)
+#target_link_libraries(commandline PRIVATE common)
+
+# Module dependencies
+# commandline interfaces convey transitive dependence on these modules.
+#target_link_libraries(commandline PUBLIC
+target_link_libraries(commandline INTERFACE
+                      utility
+                      )
+# Source files have the following private module dependencies.
+#target_link_libraries(commandline PRIVATE tng_io)
+# TODO: Explicitly link specific modules.
+#target_link_libraries(commandline PRIVATE legacy_modules)
+
 if (BUILD_TESTING)
     add_subdirectory(tests)
 endif()