From 5d1f7c8377d50d4f691ab0790041570862df4f2a Mon Sep 17 00:00:00 2001 From: "M. Eric Irrgang" Date: Fri, 20 Nov 2020 14:47:10 +0000 Subject: [PATCH] Create CMake targets for each of the modules. Establish a template for further work towards using CMake to manage module dependencies through targets and the include directories they provide. There should be no significant behavioral differences. Actual relocation of the headers is deferred. Refs #3288 --- src/gromacs/CMakeLists.txt | 54 ++++++++++++++++++- src/gromacs/analysisdata/CMakeLists.txt | 32 +++++++++++ src/gromacs/applied_forces/CMakeLists.txt | 35 ++++++++++++ src/gromacs/commandline/CMakeLists.txt | 33 ++++++++++++ src/gromacs/compat/CMakeLists.txt | 30 +++++++++++ src/gromacs/coordinateio/CMakeLists.txt | 35 +++++++++++- .../correlationfunctions/CMakeLists.txt | 38 ++++++++++++- src/gromacs/domdec/CMakeLists.txt | 32 +++++++++++ src/gromacs/essentialdynamics/CMakeLists.txt | 37 ++++++++++++- src/gromacs/ewald/CMakeLists.txt | 34 ++++++++++++ src/gromacs/fft/CMakeLists.txt | 37 ++++++++++++- src/gromacs/fileio/CMakeLists.txt | 34 ++++++++++++ src/gromacs/gmxana/CMakeLists.txt | 27 ++++++++++ src/gromacs/gmxlib/CMakeLists.txt | 34 ++++++++++++ src/gromacs/gmxpreprocess/CMakeLists.txt | 37 ++++++++++++- src/gromacs/gpu_utils/CMakeLists.txt | 34 ++++++++++++ src/gromacs/hardware/CMakeLists.txt | 29 ++++++++++ src/gromacs/imd/CMakeLists.txt | 34 +++++++++++- src/gromacs/linearalgebra/CMakeLists.txt | 5 +- src/gromacs/listed_forces/CMakeLists.txt | 32 +++++++++++ src/gromacs/math/CMakeLists.txt | 36 +++++++++++++ src/gromacs/mdlib/CMakeLists.txt | 40 ++++++++++++-- src/gromacs/mdrun/CMakeLists.txt | 33 ++++++++++++ src/gromacs/mdrunutility/CMakeLists.txt | 33 ++++++++++++ src/gromacs/mdspan/CMakeLists.txt | 9 +++- src/gromacs/mdspan/tests/CMakeLists.txt | 1 + src/gromacs/mdtypes/CMakeLists.txt | 35 ++++++++++++ src/gromacs/mimic/CMakeLists.txt | 38 +++++++++++-- src/gromacs/modularsimulator/CMakeLists.txt | 51 +++++++++++++----- src/gromacs/nbnxm/CMakeLists.txt | 28 ++++++++++ src/gromacs/onlinehelp/CMakeLists.txt | 34 +++++++++++- src/gromacs/options/CMakeLists.txt | 27 ++++++++++ src/gromacs/pbcutil/CMakeLists.txt | 32 +++++++++++ src/gromacs/pulling/CMakeLists.txt | 34 +++++++++++- src/gromacs/random/CMakeLists.txt | 34 +++++++++++- src/gromacs/restraint/CMakeLists.txt | 37 +++++++++++-- src/gromacs/selection/CMakeLists.txt | 33 ++++++++++++ src/gromacs/simd/CMakeLists.txt | 21 ++++++++ src/gromacs/statistics/CMakeLists.txt | 28 +++++++++- src/gromacs/swap/CMakeLists.txt | 33 +++++++++++- src/gromacs/tables/CMakeLists.txt | 34 +++++++++++- src/gromacs/taskassignment/CMakeLists.txt | 44 +++++++++++---- src/gromacs/timing/CMakeLists.txt | 34 +++++++++++- src/gromacs/tools/CMakeLists.txt | 36 ++++++++++++- src/gromacs/topology/CMakeLists.txt | 51 +++++++++++++----- src/gromacs/trajectory/CMakeLists.txt | 40 ++++++++++++-- src/gromacs/trajectoryanalysis/CMakeLists.txt | 32 +++++++++++ src/gromacs/utility/CMakeLists.txt | 19 +++++++ 48 files changed, 1501 insertions(+), 69 deletions(-) diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index 65bf17387a..8212a66a3d 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -328,7 +328,59 @@ target_link_libraries(libgromacs ${GMX_PUBLIC_LIBRARIES} ) target_link_libraries(libgromacs PUBLIC legacy_api) - +# Dependencies from libgromacs to the modules are set up here, but +# once the add_subdirectory() commands are re-ordered then +# responsibility for setting this up will move to the respective +# modules. +target_link_libraries(libgromacs PRIVATE + $ + $ + $ + $ + $ + $ + $ +# $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + ) if (GMX_OPENMP) target_link_libraries(libgromacs PUBLIC OpenMP::OpenMP_CXX) endif() diff --git a/src/gromacs/analysisdata/CMakeLists.txt b/src/gromacs/analysisdata/CMakeLists.txt index 43b71d60ec..c0541c80af 100644 --- a/src/gromacs/analysisdata/CMakeLists.txt +++ b/src/gromacs/analysisdata/CMakeLists.txt @@ -33,6 +33,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(analysisdata INTERFACE) file(GLOB ANALYSISDATA_SOURCES *.cpp modules/*.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ANALYSISDATA_SOURCES} PARENT_SCOPE) @@ -46,6 +47,37 @@ if(GMX_INSTALL_LEGACY_API) DESTINATION include/gromacs/analysisdata) endif() +# Source files have the following private module dependencies. +target_link_libraries(analysisdata PRIVATE +# gmxlib +# math +# mdtypes +# tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(analysisdata PUBLIC +target_include_directories(analysisdata INTERFACE + $) +#target_link_libraries(analysisdata PUBLIC +target_link_libraries(analysisdata INTERFACE + legacy_api + ) + +# TODO: when analysisdata is an OBJECT target +#target_link_libraries(analysisdata PUBLIC legacy_api) +#target_link_libraries(analysisdata PRIVATE common) + +# Module dependencies +# analysisdata interfaces convey transitive dependence on these modules. +#target_link_libraries(analysisdata PUBLIC +target_link_libraries(analysisdata INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(analysisdata PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(analysisdata PRIVATE legacy_modules) add_subdirectory(modules) diff --git a/src/gromacs/applied_forces/CMakeLists.txt b/src/gromacs/applied_forces/CMakeLists.txt index 498d44a220..92e40d3895 100644 --- a/src/gromacs/applied_forces/CMakeLists.txt +++ b/src/gromacs/applied_forces/CMakeLists.txt @@ -32,6 +32,41 @@ # 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(applied_forces INTERFACE) + +# Source files have the following private module dependencies. +target_link_libraries(applied_forces PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(applied_forces PUBLIC +target_include_directories(applied_forces INTERFACE + $) +#target_link_libraries(applied_forces PUBLIC +target_link_libraries(applied_forces INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(applied_forces PUBLIC legacy_api) +#target_link_libraries(applied_forces PRIVATE common) + +# Module dependencies +# This module convey transitive dependence on these modules. +#target_link_libraries(applied_forces PUBLIC +target_link_libraries(applied_forces INTERFACE + # utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(applied_forces PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(applied_forces PRIVATE legacy_modules) + gmx_add_libgromacs_sources( electricfield.cpp ) diff --git a/src/gromacs/commandline/CMakeLists.txt b/src/gromacs/commandline/CMakeLists.txt index 990e2f1233..8af7264ba8 100644 --- a/src/gromacs/commandline/CMakeLists.txt +++ b/src/gromacs/commandline/CMakeLists.txt @@ -32,9 +32,42 @@ # 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 + $) +#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() diff --git a/src/gromacs/compat/CMakeLists.txt b/src/gromacs/compat/CMakeLists.txt index 8332601533..1dca1942e9 100644 --- a/src/gromacs/compat/CMakeLists.txt +++ b/src/gromacs/compat/CMakeLists.txt @@ -32,6 +32,36 @@ # 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(compat INTERFACE) + +# Source files have the following private module dependencies. +target_link_libraries(compat PRIVATE + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(compat PUBLIC +target_include_directories(compat INTERFACE + $) +#target_link_libraries(compat PUBLIC +target_link_libraries(compat INTERFACE + legacy_api + ) + +# TODO: when compat is an OBJECT target +#target_link_libraries(compat PUBLIC legacy_api) +#target_link_libraries(compat PRIVATE common) + +# Module dependencies +# compat interfaces convey transitive dependence on these modules. +#target_link_libraries(compat PUBLIC +target_link_libraries(compat INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(compat PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(compat PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/coordinateio/CMakeLists.txt b/src/gromacs/coordinateio/CMakeLists.txt index 6e73817f45..ffcc961f73 100644 --- a/src/gromacs/coordinateio/CMakeLists.txt +++ b/src/gromacs/coordinateio/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2019, by the GROMACS development team, led by +# Copyright (c) 2019,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,10 +32,41 @@ # 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(coordinateio INTERFACE) file(GLOB COORDINATEIO_SOURCES *.cpp outputadapters/*.cpp) - set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${COORDINATEIO_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(coordinateio PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(coordinateio PUBLIC +target_include_directories(coordinateio INTERFACE + $) +#target_link_libraries(coordinateio PUBLIC +target_link_libraries(coordinateio INTERFACE + legacy_api + ) + +# TODO: when coordinateio is an OBJECT target +#target_link_libraries(coordinateio PUBLIC legacy_api) +#target_link_libraries(coordinateio PRIVATE common) + +# Module dependencies +# coordinateio interfaces convey transitive dependence on these modules. +#target_link_libraries(coordinateio PUBLIC +target_link_libraries(coordinateio INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(coordinateio PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(coordinateio PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/correlationfunctions/CMakeLists.txt b/src/gromacs/correlationfunctions/CMakeLists.txt index 564c52f140..8822da7899 100644 --- a/src/gromacs/correlationfunctions/CMakeLists.txt +++ b/src/gromacs/correlationfunctions/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014,2015,2016, by the GROMACS development team, led by +# Copyright (c) 2014,2015,2016,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,9 +32,45 @@ # 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(correlationfunctions INTERFACE) + file(GLOB GMXCORRFUNC_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXCORRFUNC_SOURCES} PARENT_SCOPE) + +# Source files have the following private module dependencies. +target_link_libraries(correlationfunctions PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(correlationfunctions PUBLIC +target_include_directories(correlationfunctions INTERFACE + $) +#target_link_libraries(correlationfunctions PUBLIC +target_link_libraries(correlationfunctions INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(correlationfunctions PUBLIC legacy_api) +#target_link_libraries(correlationfunctions PRIVATE common) + +# Module dependencies +# This module convey transitive dependence on these modules. +#target_link_libraries(correlationfunctions PUBLIC +target_link_libraries(correlationfunctions INTERFACE + # utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(correlationfunctions PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(correlationfunctions PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/domdec/CMakeLists.txt b/src/gromacs/domdec/CMakeLists.txt index d573003711..48fca9eebf 100644 --- a/src/gromacs/domdec/CMakeLists.txt +++ b/src/gromacs/domdec/CMakeLists.txt @@ -32,6 +32,8 @@ # 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(domdec INTERFACE) file(GLOB DOMDEC_SOURCES *.cpp) if(GMX_GPU_CUDA) @@ -40,6 +42,36 @@ endif() set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${DOMDEC_SOURCES} ${DOMDEC_CUDA_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(domdec PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(domdec PUBLIC +target_include_directories(domdec INTERFACE + $) +#target_link_libraries(domdec PUBLIC +target_link_libraries(domdec INTERFACE + legacy_api + ) + +# TODO: when domdec is an OBJECT target +#target_link_libraries(domdec PUBLIC legacy_api) +#target_link_libraries(domdec PRIVATE common) + +# Module dependencies +# domdec interfaces convey transitive dependence on these modules. +#target_link_libraries(domdec PUBLIC +target_link_libraries(domdec INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(domdec PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(domdec PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/essentialdynamics/CMakeLists.txt b/src/gromacs/essentialdynamics/CMakeLists.txt index 1edaf7a796..3f5304064b 100644 --- a/src/gromacs/essentialdynamics/CMakeLists.txt +++ b/src/gromacs/essentialdynamics/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014,2015, by the GROMACS development team, led by +# Copyright (c) 2014,2015,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,7 +32,42 @@ # 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(essentialdynamics INTERFACE) + file(GLOB ESSENTIALDYNAMICS_SOURCES *.cpp) + +# Source files have the following private module dependencies. +target_link_libraries(essentialdynamics PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(essentialdynamics PUBLIC +target_include_directories(essentialdynamics INTERFACE + $) +#target_link_libraries(essentialdynamics PUBLIC +target_link_libraries(essentialdynamics INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(fileio PUBLIC legacy_api) +#target_link_libraries(fileio PRIVATE common) + +# Module dependencies +# fileio interfaces convey transitive dependence on these modules. +#target_link_libraries(essentialdynamics PUBLIC +target_link_libraries(essentialdynamics INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(essentialdynamics PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(essentialdynamics PRIVATE legacy_modules) + set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ESSENTIALDYNAMICS_SOURCES} PARENT_SCOPE) if (BUILD_TESTING) diff --git a/src/gromacs/ewald/CMakeLists.txt b/src/gromacs/ewald/CMakeLists.txt index ba9faa378e..5699d52651 100644 --- a/src/gromacs/ewald/CMakeLists.txt +++ b/src/gromacs/ewald/CMakeLists.txt @@ -33,6 +33,8 @@ # 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(ewald INTERFACE) gmx_add_libgromacs_sources( calculate_spline_moduli.cpp ewald.cpp @@ -101,6 +103,38 @@ else() ) endif() +# Source files have the following private module dependencies. +target_link_libraries(ewald PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(ewald PUBLIC +target_include_directories(ewald INTERFACE + $) +#target_link_libraries(ewald PUBLIC +target_link_libraries(ewald INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(ewald PUBLIC legacy_api) +#target_link_libraries(ewald PRIVATE common) + +# Module dependencies +# This module convey transitive dependence on these modules. +#target_link_libraries(ewald PUBLIC +target_link_libraries(ewald INTERFACE + # utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(ewald PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(ewald PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/fft/CMakeLists.txt b/src/gromacs/fft/CMakeLists.txt index a1eaabc715..bbcd6972a8 100644 --- a/src/gromacs/fft/CMakeLists.txt +++ b/src/gromacs/fft/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013,2014,2015,2018,2019, by the GROMACS development team, led by +# Copyright (c) 2013,2014,2015,2018,2019,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,6 +32,9 @@ # 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(fft INTERFACE) + gmx_add_libgromacs_sources( calcgrid.cpp fft.cpp @@ -51,6 +54,38 @@ if (GMX_FFT_MKL) gmx_add_libgromacs_sources(fft_mkl.cpp) endif() +# Source files have the following private module dependencies. +target_link_libraries(fft PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(fft PUBLIC +target_include_directories(fft INTERFACE + $) +#target_link_libraries(fft PUBLIC +target_link_libraries(fft INTERFACE + legacy_api + ) + +# TODO: when fft is an OBJECT target +#target_link_libraries(fft PUBLIC legacy_api) +#target_link_libraries(fft PRIVATE common) + +# Module dependencies +# This module convey transitive dependence on these modules. +#target_link_libraries(fft PUBLIC +target_link_libraries(fft INTERFACE + # utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(fft PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(fft PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/fileio/CMakeLists.txt b/src/gromacs/fileio/CMakeLists.txt index 3738f1d2ad..16c4892c79 100644 --- a/src/gromacs/fileio/CMakeLists.txt +++ b/src/gromacs/fileio/CMakeLists.txt @@ -32,6 +32,8 @@ # 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(fileio INTERFACE) file(GLOB FILEIO_SOURCES *.cpp) if(GMX_USE_PLUGINS) @@ -47,6 +49,38 @@ else() list(FILTER FILEIO_SOURCES EXCLUDE REGEX ".*vmdio.cpp$") endif() +# Source files have the following private module dependencies. +target_link_libraries(fileio PRIVATE +# gmxlib +# math +# mdtypes +# tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(fileio PUBLIC +target_include_directories(fileio INTERFACE + $) +#target_link_libraries(fileio PUBLIC +target_link_libraries(fileio INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(fileio PUBLIC legacy_api) +#target_link_libraries(fileio PRIVATE common) + +# Module dependencies +# fileio interfaces convey transitive dependence on these modules. +#target_link_libraries(fileio PUBLIC +target_link_libraries(fileio INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(fileio PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(fileio PRIVATE legacy_modules) + target_sources(libgromacs PRIVATE ${FILEIO_SOURCES}) if (BUILD_TESTING) diff --git a/src/gromacs/gmxana/CMakeLists.txt b/src/gromacs/gmxana/CMakeLists.txt index 3a3a581a95..06d5636619 100644 --- a/src/gromacs/gmxana/CMakeLists.txt +++ b/src/gromacs/gmxana/CMakeLists.txt @@ -32,10 +32,37 @@ # 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(gmxana INTERFACE) + file(GLOB GMXANA_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXANA_SOURCES} PARENT_SCOPE) +# Source files have the following private module dependencies. +target_link_libraries(gmxana PRIVATE + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(gmxana PUBLIC +target_include_directories(gmxana INTERFACE + $) +#target_link_libraries(gmxana PUBLIC +target_link_libraries(gmxana INTERFACE + legacy_api + ) + +# TODO: when gmxana is an OBJECT target +#target_link_libraries(gmxana PUBLIC legacy_api) +#target_link_libraries(gmxana PRIVATE common) + +# Module dependencies +# gmxana interfaces convey transitive dependence on these modules. +#target_link_libraries(gmxana PUBLIC +target_link_libraries(gmxana INTERFACE + utility + ) + if(BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/gmxlib/CMakeLists.txt b/src/gromacs/gmxlib/CMakeLists.txt index 2e20112e90..3b830d5e1a 100644 --- a/src/gromacs/gmxlib/CMakeLists.txt +++ b/src/gromacs/gmxlib/CMakeLists.txt @@ -33,6 +33,8 @@ # 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(gmxlib INTERFACE) + add_subdirectory(nonbonded) # The nonbonded directory contains subdirectories that are only @@ -41,6 +43,38 @@ file(GLOB GMXLIB_SOURCES *.cpp) set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${NONBONDED_SOURCES} PARENT_SCOPE) +# Source files have the following private module dependencies. +target_link_libraries(gmxlib PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(gmxlib PUBLIC +target_include_directories(gmxlib INTERFACE + $) +#target_link_libraries(gmxlib PUBLIC +target_link_libraries(gmxlib INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(gmxlib PUBLIC legacy_api) +#target_link_libraries(gmxlib PRIVATE common) + +# Module dependencies +# fileio interfaces convey transitive dependence on these modules. +#target_link_libraries(gmxlib PUBLIC +target_link_libraries(gmxlib INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(gmxlib PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(gmxlib PRIVATE legacy_modules) + # if(BUILD_TESTING) # add_subdirectory(tests) # endif() diff --git a/src/gromacs/gmxpreprocess/CMakeLists.txt b/src/gromacs/gmxpreprocess/CMakeLists.txt index 8dd9c8aad8..ad4abac97b 100644 --- a/src/gromacs/gmxpreprocess/CMakeLists.txt +++ b/src/gromacs/gmxpreprocess/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2011,2013,2014,2015, by the GROMACS development team, led by +# Copyright (c) 2011,2013,2014,2015,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,10 +32,45 @@ # 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(gmxpreprocess INTERFACE) + file(GLOB GMXPREPROCESS_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXPREPROCESS_SOURCES} PARENT_SCOPE) +# Source files have the following private module dependencies. +target_link_libraries(gmxpreprocess PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(gmxpreprocess PUBLIC +target_include_directories(gmxpreprocess INTERFACE + $) +#target_link_libraries(gmxpreprocess PUBLIC +target_link_libraries(gmxpreprocess INTERFACE + legacy_api + ) + +# TODO: when is an OBJECT target +#target_link_libraries(gmxpreprocess PUBLIC legacy_api) +#target_link_libraries(gmxpreprocess PRIVATE common) + +# Module dependencies +# This module convey transitive dependence on these modules. +#target_link_libraries(gmxpreprocess PUBLIC +target_link_libraries(gmxpreprocess INTERFACE + # utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(gmxpreprocess PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(gmxpreprocess PRIVATE legacy_modules) + if(BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/gpu_utils/CMakeLists.txt b/src/gromacs/gpu_utils/CMakeLists.txt index ca34184f83..7958f18c13 100644 --- a/src/gromacs/gpu_utils/CMakeLists.txt +++ b/src/gromacs/gpu_utils/CMakeLists.txt @@ -36,6 +36,8 @@ # the incidence of textual clashes when adding/moving files that # otherwise make the end of the list a hotspot. +add_library(gpu_utils INTERFACE) + gmx_add_libgromacs_sources( clfftinitializer.cpp device_stream_manager.cpp @@ -81,6 +83,38 @@ else() ) endif() +# Source files have the following private module dependencies. +target_link_libraries(gpu_utils PRIVATE +# gmxlib +# math +# mdtypes +# tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(gpu_utils PUBLIC +target_include_directories(gpu_utils INTERFACE + $) +#target_link_libraries(gpu_utils PUBLIC +target_link_libraries(gpu_utils INTERFACE + legacy_api + ) + +# TODO: when gpu_utils is an OBJECT target +#target_link_libraries(gpu_utils PUBLIC legacy_api) +#target_link_libraries(gpu_utils PRIVATE common) + +# Module dependencies +# gpu_utils interfaces convey transitive dependence on these modules. +#target_link_libraries(gpu_utils PUBLIC +target_link_libraries(gpu_utils INTERFACE +# utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(gpu_utils PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(gpu_utils PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/hardware/CMakeLists.txt b/src/gromacs/hardware/CMakeLists.txt index 668e6ab186..da26538070 100644 --- a/src/gromacs/hardware/CMakeLists.txt +++ b/src/gromacs/hardware/CMakeLists.txt @@ -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(hardware INTERFACE) gmx_add_libgromacs_sources( cpuinfo.cpp detecthardware.cpp @@ -72,6 +73,34 @@ else() ) endif() +# Source files have the following private module dependencies. +target_link_libraries(hardware PRIVATE + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(hardware PUBLIC +target_include_directories(hardware INTERFACE + $) +#target_link_libraries(hardware PUBLIC +target_link_libraries(hardware INTERFACE + legacy_api + ) + +# TODO: when hardware is an OBJECT target +#target_link_libraries(hardware PUBLIC legacy_api) +#target_link_libraries(hardware PRIVATE common) + +# Module dependencies +# hardware interfaces convey transitive dependence on these modules. +#target_link_libraries(hardware PUBLIC +target_link_libraries(hardware INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(hardware PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(hardware PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/imd/CMakeLists.txt b/src/gromacs/imd/CMakeLists.txt index 0b47f37872..e48c21f9a0 100644 --- a/src/gromacs/imd/CMakeLists.txt +++ b/src/gromacs/imd/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014,2015, by the GROMACS development team, led by +# Copyright (c) 2014,2015,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,5 +32,37 @@ # 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(imd INTERFACE) file(GLOB IMD_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${IMD_SOURCES} PARENT_SCOPE) + +# Source files have the following private module dependencies. +target_link_libraries(imd PRIVATE +# gmxlib +# math +# mdtypes + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(imd PUBLIC +target_include_directories(imd INTERFACE + $) +#target_link_libraries(imd PUBLIC +target_link_libraries(imd INTERFACE + legacy_api + ) + +# TODO: when imd is an OBJECT target +#target_link_libraries(imd PUBLIC legacy_api) +#target_link_libraries(imd PRIVATE common) + +# Module dependencies +# imd interfaces convey transitive dependence on these modules. +#target_link_libraries(imd PUBLIC +target_link_libraries(imd INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(imd PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(imd PRIVATE legacy_modules) diff --git a/src/gromacs/linearalgebra/CMakeLists.txt b/src/gromacs/linearalgebra/CMakeLists.txt index 449b45f3ba..f908f01982 100644 --- a/src/gromacs/linearalgebra/CMakeLists.txt +++ b/src/gromacs/linearalgebra/CMakeLists.txt @@ -47,9 +47,10 @@ set(LINEARALGEBRA_SOURCES ${LINEARALGEBRA_SOURCES} ${BLAS_SOURCES} ${LAPACK_SOURCES}) add_library(linearalgebra OBJECT ${LINEARALGEBRA_SOURCES}) -target_include_directories(linearalgebra PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) # TODO: Only expose the module's public headers. -target_include_directories(linearalgebra INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(linearalgebra INTERFACE + $) +target_include_directories(linearalgebra PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) gmx_target_compile_options(linearalgebra) target_compile_definitions(linearalgebra PRIVATE HAVE_CONFIG_H) diff --git a/src/gromacs/listed_forces/CMakeLists.txt b/src/gromacs/listed_forces/CMakeLists.txt index fa1fa07902..c1de86e14b 100644 --- a/src/gromacs/listed_forces/CMakeLists.txt +++ b/src/gromacs/listed_forces/CMakeLists.txt @@ -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(listed_forces INTERFACE) gmx_add_libgromacs_sources( bonded.cpp disre.cpp @@ -52,6 +53,37 @@ if(GMX_GPU_CUDA) ) endif() +# Source files have the following private module dependencies. +target_link_libraries(listed_forces PRIVATE +# gmxlib +# math +# mdtypes + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(listed_forces PUBLIC +target_include_directories(listed_forces INTERFACE + $) +#target_link_libraries(listed_forces PUBLIC +target_link_libraries(listed_forces INTERFACE + legacy_api + ) + +# TODO: when listed_forces is an OBJECT target +#target_link_libraries(listed_forces PUBLIC legacy_api) +#target_link_libraries(listed_forces PRIVATE common) + +# Module dependencies +# listed_forces interfaces convey transitive dependence on these modules. +#target_link_libraries(listed_forces PUBLIC +target_link_libraries(listed_forces INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(listed_forces PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(listed_forces PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/math/CMakeLists.txt b/src/gromacs/math/CMakeLists.txt index a879d44e2e..4323f44e6c 100644 --- a/src/gromacs/math/CMakeLists.txt +++ b/src/gromacs/math/CMakeLists.txt @@ -33,9 +33,45 @@ # 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(math INTERFACE) + file(GLOB MATH_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${MATH_SOURCES} PARENT_SCOPE) +# Source files have the following private module dependencies. +target_link_libraries(math PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(math PUBLIC +target_include_directories(math INTERFACE + $) +#target_link_libraries(math PUBLIC +target_link_libraries(math INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(math PUBLIC legacy_api) +#target_link_libraries(math PRIVATE common) + +# Module dependencies +# fileio interfaces convey transitive dependence on these modules. +#target_link_libraries(math PUBLIC +target_link_libraries(math INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(math PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(math PRIVATE legacy_modules) + + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/mdlib/CMakeLists.txt b/src/gromacs/mdlib/CMakeLists.txt index 6cb02ee517..a9d37b516d 100644 --- a/src/gromacs/mdlib/CMakeLists.txt +++ b/src/gromacs/mdlib/CMakeLists.txt @@ -33,12 +33,11 @@ # 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(mdlib INTERFACE) + file(GLOB MDLIB_SOURCES *.cpp) set(MDLIB_SOURCES ${MDLIB_SOURCES} PARENT_SCOPE) -if (BUILD_TESTING) - add_subdirectory(tests) -endif() if(GMX_GPU_CUDA) gmx_add_libgromacs_sources( leapfrog_gpu.cu @@ -49,3 +48,38 @@ if(GMX_GPU_CUDA) ) endif() +# Source files have the following private module dependencies. +target_link_libraries(mdlib PRIVATE +# gmxlib +# math +# mdtypes +# tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(mdlib PUBLIC +target_include_directories(mdlib INTERFACE + $) +#target_link_libraries(mdlib PUBLIC +target_link_libraries(mdlib INTERFACE + legacy_api + ) + +# TODO: when mdlib is an OBJECT target +#target_link_libraries(mdlib PUBLIC legacy_api) +#target_link_libraries(mdlib PRIVATE common) + +# Module dependencies +# mdlib interfaces convey transitive dependence on these modules. +#target_link_libraries(mdlib PUBLIC +target_link_libraries(mdlib INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(mdlib PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(mdlib PRIVATE legacy_modules) + +if (BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/src/gromacs/mdrun/CMakeLists.txt b/src/gromacs/mdrun/CMakeLists.txt index cb714aff3d..d5ddaf1a78 100644 --- a/src/gromacs/mdrun/CMakeLists.txt +++ b/src/gromacs/mdrun/CMakeLists.txt @@ -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 + $) +#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 diff --git a/src/gromacs/mdrunutility/CMakeLists.txt b/src/gromacs/mdrunutility/CMakeLists.txt index b1d76c5279..6a05583991 100644 --- a/src/gromacs/mdrunutility/CMakeLists.txt +++ b/src/gromacs/mdrunutility/CMakeLists.txt @@ -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(mdrunutility INTERFACE) gmx_add_libgromacs_sources( handlerestart.cpp logging.cpp @@ -40,6 +41,38 @@ gmx_add_libgromacs_sources( threadaffinity.cpp ) +# Source files have the following private module dependencies. +target_link_libraries(mdrunutility PRIVATE +# gmxlib +# math +# mdtypes +# tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(mdrunutility PUBLIC +target_include_directories(mdrunutility INTERFACE + $) +#target_link_libraries(mdrunutility PUBLIC +target_link_libraries(mdrunutility INTERFACE + legacy_api + ) + +# TODO: when mdrunutility is an OBJECT target +#target_link_libraries(mdrunutility PUBLIC legacy_api) +#target_link_libraries(mdrunutility PRIVATE common) + +# Module dependencies +# mdrunutility interfaces convey transitive dependence on these modules. +#target_link_libraries(mdrunutility PUBLIC +target_link_libraries(mdrunutility INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(mdrunutility PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(mdrunutility PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/mdspan/CMakeLists.txt b/src/gromacs/mdspan/CMakeLists.txt index 7af2f8f080..a9640d1d0e 100644 --- a/src/gromacs/mdspan/CMakeLists.txt +++ b/src/gromacs/mdspan/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2018, by the GROMACS development team, led by +# Copyright (c) 2018,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,6 +32,13 @@ # 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(mdspan INTERFACE) + +# Public interface for modules, including dependencies and interfaces +target_include_directories(mdspan INTERFACE + $) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/mdspan/tests/CMakeLists.txt b/src/gromacs/mdspan/tests/CMakeLists.txt index 79e8dc9776..d0dd1b6239 100644 --- a/src/gromacs/mdspan/tests/CMakeLists.txt +++ b/src/gromacs/mdspan/tests/CMakeLists.txt @@ -40,3 +40,4 @@ gmx_add_unit_test(MDSpanTests mdspan-test layouts.cpp mdspan.cpp ) +target_link_libraries(mdspan-test PRIVATE mdspan) diff --git a/src/gromacs/mdtypes/CMakeLists.txt b/src/gromacs/mdtypes/CMakeLists.txt index 8f60ea640a..f4517b6cdc 100644 --- a/src/gromacs/mdtypes/CMakeLists.txt +++ b/src/gromacs/mdtypes/CMakeLists.txt @@ -32,6 +32,9 @@ # 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(mdtypes INTERFACE) + file(GLOB MDTYPES_SOURCES checkpointdata.cpp df_history.cpp @@ -66,6 +69,38 @@ else() ) endif() +# Source files have the following private module dependencies. +target_link_libraries(mdtypes PRIVATE + # gmxlib + # math + # mdtypes + # tng_io + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(mdtypes PUBLIC +target_include_directories(mdtypes INTERFACE + $) +#target_link_libraries(mdtypes PUBLIC +target_link_libraries(mdtypes INTERFACE + legacy_api + ) + +# TODO: when fileio is an OBJECT target +#target_link_libraries(mdtypes PUBLIC legacy_api) +#target_link_libraries(mdtypes PRIVATE common) + +# Module dependencies +# fileio interfaces convey transitive dependence on these modules. +#target_link_libraries(mdtypes PUBLIC +target_link_libraries(mdtypes INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(mdtypes PRIVATE tng_io) +# TODO: Explicitly link specific modules. +#target_link_libraries(mdtypes PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/mimic/CMakeLists.txt b/src/gromacs/mimic/CMakeLists.txt index 143271e29f..84040bd4c7 100644 --- a/src/gromacs/mimic/CMakeLists.txt +++ b/src/gromacs/mimic/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2018,2019, by the GROMACS development team, led by +# Copyright (c) 2018,2019,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,8 +32,38 @@ # To help us fund GROMACS development, we humbly ask that you cite # the research papers on the package. Check out http://www.gromacs.org. -gmx_add_libgromacs_sources( - communicator.cpp - utilities.cpp +# Set up the module library +add_library(mimic INTERFACE) +file(GLOB MIMIC_SOURCES *.cpp) +set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${MIMIC_SOURCES} PARENT_SCOPE) + +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(mimic PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(mimic PUBLIC +target_include_directories(mimic INTERFACE + $) +#target_link_libraries(mimic PUBLIC +target_link_libraries(mimic INTERFACE + legacy_api ) +# TODO: when mimic is an OBJECT target +#target_link_libraries(mimic PUBLIC legacy_api) +#target_link_libraries(mimic PRIVATE common) + +# Module dependencies +# mimic interfaces convey transitive dependence on these modules. +#target_link_libraries(mimic PUBLIC +target_link_libraries(mimic INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(mimic PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(mimic PRIVATE legacy_modules) + diff --git a/src/gromacs/modularsimulator/CMakeLists.txt b/src/gromacs/modularsimulator/CMakeLists.txt index f3beef27ff..327f2de5e2 100644 --- a/src/gromacs/modularsimulator/CMakeLists.txt +++ b/src/gromacs/modularsimulator/CMakeLists.txt @@ -35,30 +35,57 @@ file(GLOB MODULARSIMULATOR_SOURCES *.cpp) add_library(modularsimulator OBJECT ${MODULARSIMULATOR_SOURCES}) -target_include_directories(modularsimulator SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/src/external) -gmx_target_compile_options(modularsimulator) -target_compile_definitions(modularsimulator PRIVATE HAVE_CONFIG_H) -# Should be possible to remove this when resolving #3290 -target_include_directories(modularsimulator SYSTEM BEFORE PRIVATE ${PROJECT_SOURCE_DIR}/src/external/thread_mpi/include) -target_link_libraries(modularsimulator PRIVATE legacy_api) -# TODO: Use explicit module dependencies. -target_link_libraries(modularsimulator PRIVATE legacy_modules) -if(GMX_OPENMP) +if (GMX_OPENMP) # Explicitly set properties for modular simulator module to compile with openmp set_target_properties(modularsimulator PROPERTIES COMPILE_OPTIONS $) -endif() +endif () if (WIN32) gmx_target_warning_suppression(modularsimulator /wd4244 HAS_NO_MSVC_LOSSY_CONVERSION) gmx_target_warning_suppression(modularsimulator /wd4996 HAS_NO_MSVC_UNSAFE_FUNCTION) -else() +else () # Several std::move uses are redundant in C++14, but clang before # 3.9 had a bug that needed them. gcc 9 can warn about their use, # which we need to supress. This suppression should be removed # when GROMACS requires clang 3.9 or higher. gmx_target_warning_suppression(modularsimulator "-Wno-redundant-move" HAS_NO_REDUNDANT_MOVE) -endif() +endif () + +target_include_directories(modularsimulator SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/src/external) +gmx_target_compile_options(modularsimulator) +target_compile_definitions(modularsimulator PRIVATE HAVE_CONFIG_H) +# Should be possible to remove this when resolving #3290 +target_include_directories(modularsimulator SYSTEM BEFORE PRIVATE ${PROJECT_SOURCE_DIR}/src/external/thread_mpi/include) + +# Source files have the following private external dependencies. +target_link_libraries(modularsimulator PRIVATE tng_io) + +# Source files have the following private infrastructure dependencies. +target_link_libraries(modularsimulator PRIVATE common) + +# Source files have the following private module dependencies. +# TODO: Explicitly link specific modules. +target_link_libraries(modularsimulator PRIVATE legacy_modules) +target_link_libraries(modularsimulator PRIVATE + gmxlib + math + mdtypes + tng_io + ) + +# Public interface for modules, including dependencies and interfaces +target_include_directories(modularsimulator PUBLIC + $) +target_link_libraries(modularsimulator PUBLIC + legacy_api + ) + +# Module dependencies +# This module convey transitive dependence on these modules. +target_link_libraries(modularsimulator PUBLIC + utility + ) list(APPEND libgromacs_object_library_dependencies modularsimulator) set(libgromacs_object_library_dependencies ${libgromacs_object_library_dependencies} PARENT_SCOPE) diff --git a/src/gromacs/nbnxm/CMakeLists.txt b/src/gromacs/nbnxm/CMakeLists.txt index c576b8558d..bca3f88df9 100644 --- a/src/gromacs/nbnxm/CMakeLists.txt +++ b/src/gromacs/nbnxm/CMakeLists.txt @@ -32,6 +32,9 @@ # 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(nbnxm INTERFACE) + add_subdirectory(kernels_simd_4xm) add_subdirectory(kernels_simd_2xmm) @@ -76,3 +79,28 @@ if(GMX_GPU_OPENCL) endif() set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${NBNXM_SOURCES} PARENT_SCOPE) + + +# Source files have the following private module dependencies. +target_link_libraries(nbnxm PRIVATE + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(nbnxm PUBLIC +target_include_directories(nbnxm INTERFACE + $) +#target_link_libraries(nbnxm PUBLIC +target_link_libraries(nbnxm INTERFACE + legacy_api + ) + +# TODO: when nbnxm is an OBJECT target +#target_link_libraries(nbnxm PUBLIC legacy_api) +#target_link_libraries(nbnxm PRIVATE common) + +# Module dependencies +# nbnxm interfaces convey transitive dependence on these modules. +#target_link_libraries(nbnxm PUBLIC +target_link_libraries(nbnxm INTERFACE + utility + ) \ No newline at end of file diff --git a/src/gromacs/onlinehelp/CMakeLists.txt b/src/gromacs/onlinehelp/CMakeLists.txt index c34de31cc0..9f92f29f4e 100644 --- a/src/gromacs/onlinehelp/CMakeLists.txt +++ b/src/gromacs/onlinehelp/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by +# Copyright (c) 2012,2013,2014,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,9 +32,41 @@ # 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(onlinehelp INTERFACE) file(GLOB ONLINEHELP_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ONLINEHELP_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(onlinehelp PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(onlinehelp PUBLIC +target_include_directories(onlinehelp INTERFACE + $) +#target_link_libraries(onlinehelp PUBLIC +target_link_libraries(onlinehelp INTERFACE + legacy_api + ) + +# TODO: when onlinehelp is an OBJECT target +#target_link_libraries(onlinehelp PUBLIC legacy_api) +#target_link_libraries(onlinehelp PRIVATE common) + +# Module dependencies +# onlinehelp interfaces convey transitive dependence on these modules. +#target_link_libraries(onlinehelp PUBLIC +target_link_libraries(onlinehelp INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(onlinehelp PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(onlinehelp PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/options/CMakeLists.txt b/src/gromacs/options/CMakeLists.txt index d67ef3fa03..29e80ddc8a 100644 --- a/src/gromacs/options/CMakeLists.txt +++ b/src/gromacs/options/CMakeLists.txt @@ -33,6 +33,9 @@ # 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(options INTERFACE) + gmx_add_libgromacs_sources( abstractoption.cpp abstractsection.cpp @@ -65,6 +68,30 @@ if(GMX_INSTALL_LEGACY_API) DESTINATION include/gromacs/options) endif() +# Source files have the following private module dependencies. +target_link_libraries(options PRIVATE + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(options PUBLIC +target_include_directories(options INTERFACE + $) +#target_link_libraries(options PUBLIC +target_link_libraries(options INTERFACE + legacy_api + ) + +# TODO: when options is an OBJECT target +#target_link_libraries(options PUBLIC legacy_api) +#target_link_libraries(options PRIVATE common) + +# Module dependencies +# options interfaces convey transitive dependence on these modules. +#target_link_libraries(options PUBLIC +target_link_libraries(options INTERFACE + utility + ) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/pbcutil/CMakeLists.txt b/src/gromacs/pbcutil/CMakeLists.txt index 63a5dacfcb..57ddbc8825 100644 --- a/src/gromacs/pbcutil/CMakeLists.txt +++ b/src/gromacs/pbcutil/CMakeLists.txt @@ -32,9 +32,41 @@ # 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 + $) +#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 diff --git a/src/gromacs/pulling/CMakeLists.txt b/src/gromacs/pulling/CMakeLists.txt index 2cd5293920..88fa1a8a50 100644 --- a/src/gromacs/pulling/CMakeLists.txt +++ b/src/gromacs/pulling/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014,2015,2016, by the GROMACS development team, led by +# Copyright (c) 2014,2015,2016,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,9 +32,41 @@ # 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(pulling INTERFACE) file(GLOB PULLING_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${PULLING_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(pulling PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(pulling PUBLIC +target_include_directories(pulling INTERFACE + $) +#target_link_libraries(pulling PUBLIC +target_link_libraries(pulling INTERFACE + legacy_api + ) + +# TODO: when pulling is an OBJECT target +#target_link_libraries(pulling PUBLIC legacy_api) +#target_link_libraries(pulling PRIVATE common) + +# Module dependencies +# pulling interfaces convey transitive dependence on these modules. +#target_link_libraries(pulling PUBLIC +target_link_libraries(pulling INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(pulling PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(pulling PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/random/CMakeLists.txt b/src/gromacs/random/CMakeLists.txt index fbdf2dabdf..9605699e3a 100644 --- a/src/gromacs/random/CMakeLists.txt +++ b/src/gromacs/random/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2015,2016,2019, by the GROMACS development team, led by +# Copyright (c) 2015,2016,2019,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,9 +32,41 @@ # 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(random INTERFACE) file(GLOB RANDOM_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${RANDOM_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(random PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(random PUBLIC +target_include_directories(random INTERFACE + $) +#target_link_libraries(random PUBLIC +target_link_libraries(random INTERFACE + legacy_api + ) + +# TODO: when random is an OBJECT target +#target_link_libraries(random PUBLIC legacy_api) +#target_link_libraries(random PRIVATE common) + +# Module dependencies +# random interfaces convey transitive dependence on these modules. +#target_link_libraries(random PUBLIC +target_link_libraries(random INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(random PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(random PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/restraint/CMakeLists.txt b/src/gromacs/restraint/CMakeLists.txt index d1bc6a3e80..d2d52f521d 100644 --- a/src/gromacs/restraint/CMakeLists.txt +++ b/src/gromacs/restraint/CMakeLists.txt @@ -32,11 +32,40 @@ # 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(restraint INTERFACE) +file(GLOB RESTRAINT_SOURCES *.cpp) +set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${RESTRAINT_SOURCES} PARENT_SCOPE) -gmx_add_libgromacs_sources( - manager.cpp - restraintmdmodule.cpp - ) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(restraint PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(restraint PUBLIC +target_include_directories(restraint INTERFACE + $) +#target_link_libraries(restraint PUBLIC +target_link_libraries(restraint INTERFACE + legacy_api + ) + +# TODO: when restraint is an OBJECT target +#target_link_libraries(restraint PUBLIC legacy_api) +#target_link_libraries(restraint PRIVATE common) + +# Module dependencies +# restraint interfaces convey transitive dependence on these modules. +#target_link_libraries(restraint PUBLIC +target_link_libraries(restraint INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(restraint PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(restraint PRIVATE legacy_modules) if (BUILD_TESTING) add_subdirectory(tests) diff --git a/src/gromacs/selection/CMakeLists.txt b/src/gromacs/selection/CMakeLists.txt index 63aa3ce35e..90a4648243 100644 --- a/src/gromacs/selection/CMakeLists.txt +++ b/src/gromacs/selection/CMakeLists.txt @@ -33,6 +33,9 @@ # 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(selection INTERFACE) + file(GLOB SELECTION_SOURCES *.cpp) file(GLOB SCANNER_SOURCES scanner.cpp parser.cpp) list(REMOVE_ITEM SELECTION_SOURCES ${SCANNER_SOURCES}) @@ -63,6 +66,36 @@ target_link_libraries(scanner PRIVATE legacy_modules) list(APPEND libgromacs_object_library_dependencies scanner) set(libgromacs_object_library_dependencies ${libgromacs_object_library_dependencies} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(selection PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(selection PUBLIC +target_include_directories(selection INTERFACE + $) +#target_link_libraries(selection PUBLIC +target_link_libraries(selection INTERFACE + legacy_api + ) + +# TODO: when selection is an OBJECT target +#target_link_libraries(selection PUBLIC legacy_api) +#target_link_libraries(selection PRIVATE common) + +# Module dependencies +# selection interfaces convey transitive dependence on these modules. +#target_link_libraries(selection PUBLIC +target_link_libraries(selection INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(selection PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(selection PRIVATE legacy_modules) + if(GMX_INSTALL_LEGACY_API) install(FILES indexutil.h diff --git a/src/gromacs/simd/CMakeLists.txt b/src/gromacs/simd/CMakeLists.txt index 341d9cc90b..901d99f63f 100644 --- a/src/gromacs/simd/CMakeLists.txt +++ b/src/gromacs/simd/CMakeLists.txt @@ -32,9 +32,30 @@ # 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(simd INTERFACE) file(GLOB SIMD_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SIMD_SOURCES} PARENT_SCOPE) +# Public interface for modules, including dependencies and interfaces +#target_include_directories(simd PUBLIC +target_include_directories(simd INTERFACE + $) +#target_link_libraries(simd PUBLIC +target_link_libraries(simd INTERFACE + legacy_api + ) + +# TODO: when simd is an OBJECT target +#target_link_libraries(simd PUBLIC legacy_api) +#target_link_libraries(simd PRIVATE common) + +# Module dependencies +# simd interfaces convey transitive dependence on these modules. +#target_link_libraries(simd PUBLIC +target_link_libraries(simd INTERFACE + utility + ) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/statistics/CMakeLists.txt b/src/gromacs/statistics/CMakeLists.txt index 1fce039188..963749925f 100644 --- a/src/gromacs/statistics/CMakeLists.txt +++ b/src/gromacs/statistics/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014,2015, by the GROMACS development team, led by +# Copyright (c) 2014,2015,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,8 +32,32 @@ # 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(statistics INTERFACE) file(GLOB STATISTICS_SOURCES *.cpp) - set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${STATISTICS_SOURCES} PARENT_SCOPE) +# Public interface for modules, including dependencies and interfaces +#target_include_directories(statistics PUBLIC +target_include_directories(statistics INTERFACE + $) +#target_link_libraries(statistics PUBLIC +target_link_libraries(statistics INTERFACE + legacy_api + ) + +# TODO: when statistics is an OBJECT target +#target_link_libraries(statistics PUBLIC legacy_api) +#target_link_libraries(statistics PRIVATE common) + +# Module dependencies +# statistics interfaces convey transitive dependence on these modules. +#target_link_libraries(statistics PUBLIC +target_link_libraries(statistics INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(statistics PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(statistics PRIVATE legacy_modules) diff --git a/src/gromacs/swap/CMakeLists.txt b/src/gromacs/swap/CMakeLists.txt index 8ebac9a96c..eb7dea6d04 100644 --- a/src/gromacs/swap/CMakeLists.txt +++ b/src/gromacs/swap/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013,2014,2015, by the GROMACS development team, led by +# Copyright (c) 2013,2014,2015,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,6 +32,37 @@ # 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(swap INTERFACE) file(GLOB SWAP_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SWAP_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(swap PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(swap PUBLIC +target_include_directories(swap INTERFACE + $) +#target_link_libraries(swap PUBLIC +target_link_libraries(swap INTERFACE + legacy_api + ) + +# TODO: when swap is an OBJECT target +#target_link_libraries(swap PUBLIC legacy_api) +#target_link_libraries(swap PRIVATE common) + +# Module dependencies +# swap interfaces convey transitive dependence on these modules. +#target_link_libraries(swap PUBLIC +target_link_libraries(swap INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(swap PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(swap PRIVATE legacy_modules) diff --git a/src/gromacs/tables/CMakeLists.txt b/src/gromacs/tables/CMakeLists.txt index 935f31a0fc..1bb2374cc9 100644 --- a/src/gromacs/tables/CMakeLists.txt +++ b/src/gromacs/tables/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2015,2016, by the GROMACS development team, led by +# Copyright (c) 2015,2016,200, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,9 +32,41 @@ # 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(tables INTERFACE) file(GLOB TABLE_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TABLE_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(tables PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(tables PUBLIC +target_include_directories(tables INTERFACE + $) +#target_link_libraries(tables PUBLIC +target_link_libraries(tables INTERFACE + legacy_api + ) + +# TODO: when tables is an OBJECT target +#target_link_libraries(tables PUBLIC legacy_api) +#target_link_libraries(tables PRIVATE common) + +# Module dependencies +# tables interfaces convey transitive dependence on these modules. +#target_link_libraries(tables PUBLIC +target_link_libraries(tables INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(tables PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(tables PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/taskassignment/CMakeLists.txt b/src/gromacs/taskassignment/CMakeLists.txt index 22a1c70eec..f3db1e1e3c 100644 --- a/src/gromacs/taskassignment/CMakeLists.txt +++ b/src/gromacs/taskassignment/CMakeLists.txt @@ -32,19 +32,45 @@ # 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(taskassignment INTERFACE) +file(GLOB TASKASSIGNMENT_SOURCES *.cpp) +set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TASKASSIGNMENT_SOURCES} PARENT_SCOPE) + # Note that this is a higher-level module that should not need # special compilation to suit e.g. GPU or MPI dependencies. # If you find you want to do that, consider a preliminary # refactoring. -gmx_add_libgromacs_sources( - decidegpuusage.cpp - decidesimulationworkload.cpp - findallgputasks.cpp - reportgpuusage.cpp - resourcedivision.cpp - taskassignment.cpp - usergpuids.cpp - ) + +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(taskassignment PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(taskassignment PUBLIC +target_include_directories(taskassignment INTERFACE + $) +#target_link_libraries(taskassignment PUBLIC +target_link_libraries(taskassignment INTERFACE + legacy_api + ) + +# TODO: when taskassignment is an OBJECT target +#target_link_libraries(taskassignment PUBLIC legacy_api) +#target_link_libraries(taskassignment PRIVATE common) + +# Module dependencies +# taskassignment interfaces convey transitive dependence on these modules. +#target_link_libraries(taskassignment PUBLIC +target_link_libraries(taskassignment INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(taskassignment PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(taskassignment PRIVATE legacy_modules) if (BUILD_TESTING) add_subdirectory(tests) diff --git a/src/gromacs/timing/CMakeLists.txt b/src/gromacs/timing/CMakeLists.txt index cf359bd487..84617fcdeb 100644 --- a/src/gromacs/timing/CMakeLists.txt +++ b/src/gromacs/timing/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013,2014,2015,2019, by the GROMACS development team, led by +# Copyright (c) 2013,2014,2015,2019,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,9 +32,41 @@ # 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(timing INTERFACE) file(GLOB TIMING_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TIMING_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(timing PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(timing PUBLIC +target_include_directories(timing INTERFACE + $) +#target_link_libraries(timing PUBLIC +target_link_libraries(timing INTERFACE + legacy_api + ) + +# TODO: when timing is an OBJECT target +#target_link_libraries(timing PUBLIC legacy_api) +#target_link_libraries(timing PRIVATE common) + +# Module dependencies +# timing interfaces convey transitive dependence on these modules. +#target_link_libraries(timing PUBLIC +target_link_libraries(timing INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(timing PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(timing PRIVATE legacy_modules) + if (BUILD_TESTING) # add_subdirectory(tests) endif() diff --git a/src/gromacs/tools/CMakeLists.txt b/src/gromacs/tools/CMakeLists.txt index 442b77b234..747d39cbb1 100644 --- a/src/gromacs/tools/CMakeLists.txt +++ b/src/gromacs/tools/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2014,2015,2018, by the GROMACS development team, led by +# Copyright (c) 2014,2015,2018,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,9 +32,43 @@ # 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(tools INTERFACE) file(GLOB TOOLS_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOOLS_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(tools PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(tools PUBLIC +target_include_directories(tools INTERFACE + $) +#target_link_libraries(tools PUBLIC +target_link_libraries(tools INTERFACE + legacy_api + ) + +# TODO: when tools is an OBJECT target +#target_link_libraries(tools PUBLIC legacy_api) +#target_link_libraries(tools PRIVATE common) + +# Module dependencies +# tools interfaces convey transitive dependence on these modules. +#target_link_libraries(tools PUBLIC +target_link_libraries(tools INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(tools PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(tools PRIVATE legacy_modules) + + + if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/gromacs/topology/CMakeLists.txt b/src/gromacs/topology/CMakeLists.txt index 547af12c8d..e6e2232e7c 100644 --- a/src/gromacs/topology/CMakeLists.txt +++ b/src/gromacs/topology/CMakeLists.txt @@ -32,23 +32,50 @@ # 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(topology INTERFACE) + file(GLOB TOPOLOGY_SOURCES *.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOPOLOGY_SOURCES} PARENT_SCOPE) -if (BUILD_TESTING) - add_subdirectory(tests) -endif() - if(GMX_INSTALL_LEGACY_API) install(FILES atomprop.h - atoms.h - block.h - forcefieldparameters.h - idef.h - ifunc.h + atoms.h + block.h + forcefieldparameters.h + idef.h + ifunc.h index.h - symtab.h - topology.h - DESTINATION include/gromacs/topology) + symtab.h + topology.h + DESTINATION include/gromacs/topology) endif() + +# Source files have the following private module dependencies. +target_link_libraries(options PRIVATE + ) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(topology PUBLIC +target_include_directories(topology INTERFACE + $) +#target_link_libraries(topology PUBLIC +target_link_libraries(topology INTERFACE + legacy_api + ) + +# TODO: when topology is an OBJECT target +#target_link_libraries(topology PUBLIC legacy_api) +#target_link_libraries(topology PRIVATE common) + +# Module dependencies +# topology interfaces convey transitive dependence on these modules. +#target_link_libraries(topology PUBLIC +target_link_libraries(topology INTERFACE + utility + ) + +if (BUILD_TESTING) + add_subdirectory(tests) +endif() \ No newline at end of file diff --git a/src/gromacs/trajectory/CMakeLists.txt b/src/gromacs/trajectory/CMakeLists.txt index af69089313..2a3c613419 100644 --- a/src/gromacs/trajectory/CMakeLists.txt +++ b/src/gromacs/trajectory/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2015,2016,2018,2019, by the GROMACS development team, led by +# Copyright (c) 2015,2016,2018,2019,2020, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -32,10 +32,40 @@ # To help us fund GROMACS development, we humbly ask that you cite # the research papers on the package. Check out http://www.gromacs.org. -gmx_add_libgromacs_sources( - energyframe.cpp - trajectoryframe.cpp - ) +# Set up the module library +add_library(trajectory INTERFACE) +file(GLOB TRAJECTORY_SOURCES *.cpp) +set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TRAJECTORY_SOURCES} PARENT_SCOPE) + +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(trajectory PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(trajectory PUBLIC +target_include_directories(trajectory INTERFACE + $) +#target_link_libraries(trajectory PUBLIC +target_link_libraries(trajectory INTERFACE + legacy_api + ) + +# TODO: when trajectory is an OBJECT target +#target_link_libraries(trajectory PUBLIC legacy_api) +#target_link_libraries(trajectory PRIVATE common) + +# Module dependencies +# trajectory interfaces convey transitive dependence on these modules. +#target_link_libraries(trajectory PUBLIC +target_link_libraries(trajectory INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(trajectory PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(trajectory PRIVATE legacy_modules) if(GMX_INSTALL_LEGACY_API) install(FILES trajectoryframe.h diff --git a/src/gromacs/trajectoryanalysis/CMakeLists.txt b/src/gromacs/trajectoryanalysis/CMakeLists.txt index 9065899640..09ac59bfe4 100644 --- a/src/gromacs/trajectoryanalysis/CMakeLists.txt +++ b/src/gromacs/trajectoryanalysis/CMakeLists.txt @@ -33,9 +33,41 @@ # 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(trajectoryanalysis INTERFACE) file(GLOB TRAJECTORYANALYSIS_SOURCES *.cpp modules/*.cpp) set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TRAJECTORYANALYSIS_SOURCES} PARENT_SCOPE) +# Source files have the following dependencies on library infrastructure. +#target_link_libraries(trajectoryanalysis PRIVATE +# common +# legacy_modules +#) + +# Public interface for modules, including dependencies and interfaces +#target_include_directories(trajectoryanalysis PUBLIC +target_include_directories(trajectoryanalysis INTERFACE + $) +#target_link_libraries(trajectoryanalysis PUBLIC +target_link_libraries(trajectoryanalysis INTERFACE + legacy_api + ) + +# TODO: when trajectoryanalysis is an OBJECT target +#target_link_libraries(trajectoryanalysis PUBLIC legacy_api) +#target_link_libraries(trajectoryanalysis PRIVATE common) + +# Module dependencies +# trajectoryanalysis interfaces convey transitive dependence on these modules. +#target_link_libraries(trajectoryanalysis PUBLIC +target_link_libraries(trajectoryanalysis INTERFACE + utility + ) +# Source files have the following private module dependencies. +#target_link_libraries(trajectoryanalysis PRIVATE NOTHING) +# TODO: Explicitly link specific modules. +#target_link_libraries(trajectoryanalysis PRIVATE legacy_modules) + if(GMX_INSTALL_LEGACY_API) install(FILES analysismodule.h diff --git a/src/gromacs/utility/CMakeLists.txt b/src/gromacs/utility/CMakeLists.txt index d4d9c0a5e3..342b7eeceb 100644 --- a/src/gromacs/utility/CMakeLists.txt +++ b/src/gromacs/utility/CMakeLists.txt @@ -33,6 +33,8 @@ # 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(utility INTERFACE) + file(GLOB UTILITY_SOURCES *.cpp) if (GMX_GPU_CUDA) gmx_add_libgromacs_sources(cuda_version_information.cu) @@ -56,6 +58,23 @@ if(GMX_INSTALL_LEGACY_API) DESTINATION include/gromacs/utility) endif() +# Public interface for modules, including dependencies and interfaces +#target_include_directories(utility PUBLIC +target_include_directories(utility INTERFACE + $) +#target_link_libraries(utility PUBLIC +target_link_libraries(utility INTERFACE + legacy_api + ) + +# TODO: when utility is an OBJECT target +#target_link_libraries(utility PUBLIC legacy_api) +#target_link_libraries(utility PRIVATE common) + +# Source files have the following private module dependencies. +# TODO: Explicitly link specific modules. +#target_link_libraries(utility PRIVATE legacy_modules) + if (BUILD_TESTING) add_subdirectory(tests) endif() -- 2.22.0