More robust handling for installed headers
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 19 Sep 2014 19:45:34 +0000 (22:45 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 3 Oct 2014 15:28:26 +0000 (17:28 +0200)
- Remove unnecessary first parameter from gmx_install_headers():
  it is possible to deduce the installation destination from the
  current CMake directory.  This eliminates the possibility of typos in
  this parameter that would break the installed headers.
- Make the gmx_install_headers() function also generate a global list of
  installed headers, which is then used to generate a file with this
  list, instead of globbing this information from the
  cmake_install.cmake files.  This ensures that obsolete files in the
  build tree should not affect the outcome.

Change-Id: I4d27accaebc14438acc5d290b25258b561ca04ea

23 files changed:
docs/doxygen/CMakeLists.txt
docs/doxygen/gmxtree.py
src/gromacs/CMakeLists.txt
src/gromacs/analysisdata/CMakeLists.txt
src/gromacs/analysisdata/modules/CMakeLists.txt
src/gromacs/commandline/CMakeLists.txt
src/gromacs/fft/CMakeLists.txt
src/gromacs/fileio/CMakeLists.txt
src/gromacs/gmxana/CMakeLists.txt
src/gromacs/legacyheaders/CMakeLists.txt
src/gromacs/legacyheaders/types/CMakeLists.txt [moved from docs/doxygen/getInstalledHeaders.cmake with 64% similarity]
src/gromacs/linearalgebra/CMakeLists.txt
src/gromacs/listed-forces/CMakeLists.txt
src/gromacs/math/CMakeLists.txt
src/gromacs/options/CMakeLists.txt
src/gromacs/pbcutil/CMakeLists.txt
src/gromacs/selection/CMakeLists.txt
src/gromacs/swap/CMakeLists.txt
src/gromacs/timing/CMakeLists.txt
src/gromacs/tools/CMakeLists.txt
src/gromacs/topology/CMakeLists.txt
src/gromacs/trajectoryanalysis/CMakeLists.txt
src/gromacs/utility/CMakeLists.txt

index 3dc0946222ed8a46e39999f1b214e7d1145d18a5..812650593e81c550052194ac13da553251303c1b 100644 (file)
@@ -62,21 +62,10 @@ if (PYTHONINTERP_FOUND AND NOT PYTHON_VERSION_STRING VERSION_LESS "2.6")
     set(USE_PYTHON_SCRIPTS ON)
 endif()
 
-# Create a stamp file whenever cmake is run, as the list of installed files may
-# have changed.
-gmx_get_stamp_filename(configure_stamp_file cmake-configure)
-file(WRITE ${configure_stamp_file} "Timestamp for configuration")
 # Note that if you relocate this file, you also need to change gmxtree.py.
-set(INSTALLED_HEADERS_FILE ${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt)
-gmx_add_custom_output_target(find-installed-headers
-    OUTPUT ${INSTALLED_HEADERS_FILE}
-    COMMAND ${CMAKE_COMMAND}
-        -D SRCDIR=${CMAKE_SOURCE_DIR}
-        -D BUILDDIR=${CMAKE_BINARY_DIR}
-        -D OUTFILE=${INSTALLED_HEADERS_FILE}
-        -P ${CMAKE_CURRENT_SOURCE_DIR}/getInstalledHeaders.cmake
-    DEPENDS ${configure_stamp_file}
-    COMMENT "Generating installed headers list")
+# TODO: Try to find a solution where this would be hard-coded here, completely
+# separate from the logic that generates it.
+set(INSTALLED_HEADERS_FILE ${PROJECT_BINARY_DIR}/src/gromacs/installed-headers.txt)
 
 ########################################################################
 # Doxygen configuration
@@ -178,13 +167,12 @@ if (DOXYGEN_FOUND)
                 -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}
                 --ignore-cycles ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt
                 -o ${DEPGRAPH_DIR}
-            DEPENDS doc-xml find-installed-headers
+            DEPENDS doc-xml ${INSTALLED_HEADER_FILE}
                 ${CMAKE_CURRENT_SOURCE_DIR}/doxygenxml.py
                 ${CMAKE_CURRENT_SOURCE_DIR}/gmxtree.py
                 ${CMAKE_CURRENT_SOURCE_DIR}/graphbuilder.py
                 ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt
             COMMENT "Generating include dependency graphs for dot")
-        add_dependencies(dep-graphs-dot-fast find-installed-headers)
 
         # Add separate targets for converting the .dot files to .png.
         # These are not needed by the Doxygen targets, but are useful for
@@ -227,7 +215,6 @@ if (DOXYGEN_FOUND)
             COMMENT "Checking Doxygen documentation" VERBATIM)
         add_custom_target(doc-check-fast COMMAND ${doc_check_command}
             COMMENT "Checking Doxygen documentation" VERBATIM)
-        add_dependencies(doc-check      doc-xml find-installed-headers)
-        add_dependencies(doc-check-fast find-installed-headers)
+        add_dependencies(doc-check      doc-xml)
     endif()
 endif()
index 6359b6391eca4b115a9df8541518e0b56ac6f98a..6f12d22e3e1c08c8e1831dad6c5a1760f884a3fa 100644 (file)
@@ -627,7 +627,7 @@ class GromacsTree(object):
     .gitattributes for all the files.
 
     load_installed_file_list() can be called to load the list of installed
-    files from the build tree (generated by the find-installed-headers target).
+    files from the build tree (generated by CMake).
 
     scan_files() can be called to read all the files and initialize #include
     dependencies between the files based on the information.  This is done like
@@ -911,7 +911,7 @@ class GromacsTree(object):
 
     def load_installed_file_list(self):
         """Load list of installed files from the build tree."""
-        listpath = os.path.join(self._build_root, 'docs', 'doxygen', 'installed-headers.txt')
+        listpath = os.path.join(self._build_root, 'src', 'gromacs', 'installed-headers.txt')
         with open(listpath, 'r') as installedfp:
             for line in installedfp:
                 path = line.strip()
index 56022c0987ddfb7684e6a2066cc32ed9aa37fa01..deeca78c5816181aba81cf9c30fc280c904dbd0a 100644 (file)
 
 set(LIBGROMACS_SOURCES)
 
-function (gmx_install_headers DESTINATION)
+set_property(GLOBAL PROPERTY GMX_INSTALLED_HEADERS)
+
+function (gmx_install_headers)
     if (NOT GMX_BUILD_MDRUN_ONLY)
-        if (DESTINATION)
-            set(DESTINATION ${INCL_INSTALL_DIR}/gromacs/${DESTINATION})
+        file(RELATIVE_PATH _dest ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_LIST_DIR})
+        install(FILES       ${ARGN}
+                DESTINATION "${INCL_INSTALL_DIR}/${_dest}"
+                COMPONENT   development)
+    endif()
+    foreach (_file ${ARGN})
+        if (IS_ABSOLUTE "${_file}")
+            set_property(GLOBAL APPEND PROPERTY GMX_INSTALLED_HEADERS ${_file})
         else()
-            set(DESTINATION ${INCL_INSTALL_DIR}/gromacs)
+            set_property(GLOBAL APPEND PROPERTY GMX_INSTALLED_HEADERS
+                         ${CMAKE_CURRENT_LIST_DIR}/${_file})
         endif()
-        install(FILES ${ARGN} DESTINATION ${DESTINATION} COMPONENT development)
-    endif()
+    endforeach()
 endfunction ()
 
+function (gmx_write_installed_header_list)
+    get_property(_list GLOBAL PROPERTY GMX_INSTALLED_HEADERS)
+    string(REPLACE ";" "\n" _list "${_list}")
+    # TODO: Make this only update the file timestamp if the contents actually change.
+    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt "${_list}")
+endfunction()
+
 if(GMX_USE_TNG)
     option(GMX_EXTERNAL_TNG "Use external TNG instead of compiling the version shipped with GROMACS."
            OFF)
@@ -117,16 +132,16 @@ list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES})
 tmpi_get_source_list(THREAD_MPI_SOURCES ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/src)
 list(APPEND LIBGROMACS_SOURCES ${THREAD_MPI_SOURCES})
 
-set(LIBGROMACS_HEADERS
+configure_file(version.h.cmakein version.h)
+gmx_install_headers(
     analysisdata.h
     commandline.h
     options.h
     selection.h
     trajectoryanalysis.h
-    utility.h)
-configure_file(version.h.cmakein version.h)
-gmx_install_headers("" ${LIBGROMACS_HEADERS})
-gmx_install_headers("" ${CMAKE_CURRENT_BINARY_DIR}/version.h)
+    utility.h
+    ${CMAKE_CURRENT_BINARY_DIR}/version.h
+    )
 
 # This code is here instead of utility/CMakeLists.txt, because CMake
 # custom commands and source file properties can only be set in the directory
@@ -191,6 +206,8 @@ set_target_properties(libgromacs PROPERTIES
                       VERSION ${LIBRARY_VERSION}
                       COMPILE_FLAGS "${OpenMP_C_FLAGS}")
 
+gmx_write_installed_header_list()
+
 # Only install the library in mdrun-only mode if it is actually necessary
 # for the binary
 if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
index dabcba9a84e6e825292e79650a5895fafc6f7f9f..d03af36baacb6bbfec342062fba8dfdfa71bf0ee 100644 (file)
 file(GLOB ANALYSISDATA_SOURCES *.cpp modules/*.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ANALYSISDATA_SOURCES} PARENT_SCOPE)
 
-set(ANALYSISDATA_PUBLIC_HEADERS
+gmx_install_headers(
     abstractdata.h
     analysisdata.h
     arraydata.h
     dataframe.h
-    datamodule.h)
-gmx_install_headers(analysisdata ${ANALYSISDATA_PUBLIC_HEADERS})
+    datamodule.h
+    )
 
 add_subdirectory(modules)
 
index e865340e5dd4c357158e8b2a374f84bd032099e6..61d8bc59a7c5c0c482d1736858a777546f07712f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2013, by the GROMACS development team, led by
+# Copyright (c) 2010,2013,2014, 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.
 # 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(ANALYSISDATA_MODULES_PUBLIC_HEADERS
+gmx_install_headers(
     average.h
     displacement.h
     histogram.h
     lifetime.h
-    plot.h)
-gmx_install_headers(analysisdata/modules ${ANALYSISDATA_MODULES_PUBLIC_HEADERS})
+    plot.h
+    )
index 5efde47341da86d99794c6110aa9b77f1c8bae44..08eeb550c770bc39e1e85af9ac17d2633e25208b 100644 (file)
 file(GLOB COMMANDLINE_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${COMMANDLINE_SOURCES} PARENT_SCOPE)
 
-set(COMMANDLINE_PUBLIC_HEADERS
+gmx_install_headers(
     cmdlinehelpwriter.h
     cmdlineinit.h
     cmdlinemodule.h
     cmdlineparser.h
     cmdlineprogramcontext.h
-    pargs.h)
-gmx_install_headers(commandline ${COMMANDLINE_PUBLIC_HEADERS})
+    pargs.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index 5de9782aa6bf3f226ef617a26c4ffab8cd09cfbe..60d6402d863b16b7fbe6aed14e51aa63e4016c69 100644 (file)
@@ -51,9 +51,7 @@ endif()
 set(LIBGROMACS_SOURCES
     ${LIBGROMACS_SOURCES} ${FFT_SOURCES} ${FFT_SPECIFIC_SOURCES} PARENT_SCOPE)
 
-set(FFT_PUBLIC_HEADERS
-    fft.h)
-gmx_install_headers(fft ${FFT_PUBLIC_HEADERS})
+gmx_install_headers(fft.h)
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index 99955060a2e3ee9fc4e137c9656f93e605422d1e..0c638a78a8b7e026bb47f96b48ff3bca28d3bd9b 100644 (file)
@@ -42,7 +42,7 @@ endif()
 
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${FILEIO_SOURCES} PARENT_SCOPE)
 
-set(FILEIO_PUBLIC_HEADERS
+gmx_install_headers(
     confio.h
     enxio.h
     filenm.h
@@ -60,7 +60,6 @@ set(FILEIO_PUBLIC_HEADERS
     xtcio.h
     xvgr.h
     )
-gmx_install_headers(fileio ${FILEIO_PUBLIC_HEADERS})
 
 if (GMX_USE_TNG AND TNG_IO_DEFINITIONS)
     set_property(SOURCE tngio.cpp
index 7c3b7da4a00b1b6183ea07e32449e77f9f8e1de4..19772897542846ae9505d66fffe081a59a3449fd 100644 (file)
 
 file(GLOB GMXANA_SOURCES *.c *.cpp)
 
-set(GMXANA_PUBLIC_HEADERS
+gmx_install_headers(
     gstat.h
     )
-gmx_install_headers(gmxana ${GMXANA_PUBLIC_HEADERS})
 
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXANA_SOURCES} PARENT_SCOPE)
 
index aea277ee6f368c7da4acdf92c91841df878eb8d0..f5737e0f02671a282b3dc0f27430898e28eef78b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2014, 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.
 # the research papers on the package. Check out http://www.gromacs.org.
 
 # includes: Nothing to build, just installation
-file(GLOB ROOT_LEGACY_HEADERS          *.h)
-file(GLOB ROOT_LEGACY_HEADERS_PRIVATE  thread_mpi.h tmpi.h gmx_hash.h 
-     gmx_ga2la.h gpu_utils.h pmalloc_cuda.h)
-file(GLOB TYPES_LEGACY_HEADERS         types/*.h)
-file(GLOB TYPES_LEGACY_HEADERS_PRIVATE types/commrec.h)
-list(REMOVE_ITEM ROOT_LEGACY_HEADERS   ${ROOT_LEGACY_HEADERS_PRIVATE})
-list(REMOVE_ITEM TYPES_LEGACY_HEADERS  ${TYPES_LEGACY_HEADERS_PRIVATE})
-gmx_install_headers(legacyheaders                   ${ROOT_LEGACY_HEADERS})
-gmx_install_headers(legacyheaders/types             ${TYPES_LEGACY_HEADERS})
+file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
+list(REMOVE_ITEM HEADERS gmx_hash.h gmx_ga2la.h gpu_utils.h pmalloc_cuda.h)
+gmx_install_headers(${HEADERS})
+
+add_subdirectory(types)
similarity index 64%
rename from docs/doxygen/getInstalledHeaders.cmake
rename to src/gromacs/legacyheaders/types/CMakeLists.txt
index 60fe80559651957744d0ba900ea2b5387b6a8c0b..ee38c567f42e5de3692e9afc249d7e9c3e773564 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.
 
-function (generate_installed_file_list SRCDIR BUILDDIR OUTFILE)
-    file(GLOB_RECURSE INSTALL_FILE_LIST "${BUILDDIR}/cmake_install.cmake")
-    set(MATCH_REGEX "(${SRCDIR}|${BUILDDIR})/.*\\.h")
-    set(HEADER_LIST)
-    foreach (INSTALL_FILE ${INSTALL_FILE_LIST})
-        file(STRINGS ${INSTALL_FILE} HEADER_LINES REGEX "${MATCH_REGEX}")
-        foreach (HEADER_LINE ${HEADER_LINES})
-            string (REGEX MATCH "${MATCH_REGEX}" HEADER "${HEADER_LINE}")
-            list(APPEND HEADER_LIST "${HEADER}")
-        endforeach ()
-    endforeach ()
-    string(REPLACE ";" "\n" HEADER_LIST "${HEADER_LIST}")
-    file(WRITE ${OUTFILE} "${HEADER_LIST}")
-endfunction ()
-
-if (NOT DEFINED SRCDIR OR NOT DEFINED BUILDDIR OR NOT DEFINED OUTFILE)
-    message(FATAL_ERROR "Required input variable (SRCDIR, BUILDDIR, OUTFILE) not set")
-endif ()
-generate_installed_file_list(${SRCDIR} ${BUILDDIR} ${OUTFILE})
+# includes: Nothing to build, just installation
+file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
+list(REMOVE_ITEM HEADERS commrec.h)
+gmx_install_headers(${HEADERS})
index b6f14b265bbfac49956bef68aee5e919cb4d19c9..c0c1ed82f44b9724e2493b0d88d4caffb0f0f7f3 100644 (file)
@@ -48,8 +48,8 @@ set(LINEARALGEBRA_SOURCES
 set(LIBGROMACS_SOURCES
     ${LIBGROMACS_SOURCES} ${LINEARALGEBRA_SOURCES} PARENT_SCOPE)
 
-set(LINEARALGEBRA_PUBLIC_HEADERS
+gmx_install_headers(
     eigensolver.h
     matrix.h
-    sparsematrix.h)
-gmx_install_headers(linearalgebra ${LINEARALGEBRA_PUBLIC_HEADERS})
+    sparsematrix.h
+    )
index 721f4fbde2cce5640315e379a5d2955f4982901f..605799ebafaf9e3f1089756d2ea83326534f6365 100644 (file)
 file(GLOB LISTED_FORCES_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${LISTED_FORCES_SOURCES} PARENT_SCOPE)
 
-set(LISTED_FORCES_PUBLIC_HEADERS
-    bonded.h)
-
-gmx_install_headers(listed-forces ${LISTED_FORCES_PUBLIC_HEADERS})
+gmx_install_headers(
+    bonded.h
+    )
 
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
index 5e94351eb29dc8b84969b4e5c9b9a8fe4ab3ca94..6b3da2e9a655d76472553a35aac4864af89eb131 100644 (file)
@@ -35,7 +35,7 @@
 file(GLOB MATH_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${MATH_SOURCES} PARENT_SCOPE)
 
-set(MATH_PUBLIC_HEADERS
+gmx_install_headers(
     3dtransforms.h
     gmxcomplex.h
     do_fit.h
@@ -44,7 +44,6 @@ set(MATH_PUBLIC_HEADERS
     vec.h
     vectypes.h
     )
-gmx_install_headers(math ${MATH_PUBLIC_HEADERS})
 
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
index 446c55228a5a3401cae1ecf62c72d45c6cbd9014..a04d94e1a184ab50c61fe45137f0f43c1ec62f4c 100644 (file)
@@ -35,7 +35,7 @@
 file(GLOB OPTIONS_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${OPTIONS_SOURCES} PARENT_SCOPE)
 
-set(OPTIONS_PUBLIC_HEADERS
+gmx_install_headers(
     abstractoption.h
     basicoptions.h
     filenameoption.h
@@ -43,8 +43,8 @@ set(OPTIONS_PUBLIC_HEADERS
     optionfiletype.h
     optionflags.h
     options.h
-    timeunitmanager.h)
-gmx_install_headers(options ${OPTIONS_PUBLIC_HEADERS})
+    timeunitmanager.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index 0366753a1b6b1890a0dcdd388fadd06077fa6ef5..793ba194906e5f4409da15673ca1f23c25a07bb5 100644 (file)
 file(GLOB PBCUTIL_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${PBCUTIL_SOURCES} PARENT_SCOPE)
 
-set(PBCUTIL_PUBLIC_HEADERS
+gmx_install_headers(
     ishift.h
     pbc.h
-    rmpbc.h)
-
-gmx_install_headers(pbcutil ${PBCUTIL_PUBLIC_HEADERS})
+    rmpbc.h
+    )
 
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
index 4788a17578a1aa2e0b96d86260c94bd50ba163a5..02e565c82ac7d1b67c79d8e9e5b6f53438c32e2f 100644 (file)
@@ -35,7 +35,7 @@
 file(GLOB SELECTION_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SELECTION_SOURCES} PARENT_SCOPE)
 
-set(SELECTION_PUBLIC_HEADERS
+gmx_install_headers(
     nbsearch.h
     indexutil.h
     position.h
@@ -43,8 +43,8 @@ set(SELECTION_PUBLIC_HEADERS
     selectioncollection.h
     selectionenums.h
     selectionoption.h
-    selectionoptionmanager.h)
-gmx_install_headers(selection ${SELECTION_PUBLIC_HEADERS})
+    selectionoptionmanager.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index b0d4346a0a46330237f80858a13af2986392ee93..909c5c3f729ed0d36cac4186521187202b30ac8a 100644 (file)
@@ -35,4 +35,4 @@
 file(GLOB SWAP_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SWAP_SOURCES} PARENT_SCOPE)
 
-gmx_install_headers(swap enums.h)
+gmx_install_headers(enums.h)
index 094cb6f298b50bf4e9453958e22dedd3e2c5d08a..f0a5af0a1b4e7a58d693ec80898d4e1b95dcd558 100644 (file)
 file(GLOB TIMING_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TIMING_SOURCES} PARENT_SCOPE)
 
-set(TIMING_PUBLIC_HEADERS
+gmx_install_headers(
     wallcycle.h
-    walltime_accounting.h)
-
-gmx_install_headers(timing ${TIMING_PUBLIC_HEADERS})
+    walltime_accounting.h
+    )
 
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
index ac60f30f0f369d34c6573c373c9e03d2aed17f56..ceec518fe6a0b676c3bdbaae0d708bbe3c511021 100644 (file)
 file(GLOB TOOLS_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOOLS_SOURCES} PARENT_SCOPE)
 
-set(TOOLS_PUBLIC_HEADERS
-    )
-gmx_install_headers(tools ${TOOLS_PUBLIC_HEADERS})
-
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
 endif()
index ffc2379e839c32e2177ce1bbd747868e8e8457cf..fc8b5463b9f1045d28f191d21c8315c14dd4ee9c 100644 (file)
@@ -35,7 +35,7 @@
 file(GLOB TOPOLOGY_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOPOLOGY_SOURCES} PARENT_SCOPE)
 
-set(TOPOLOGY_PUBLIC_HEADERS
+gmx_install_headers(
     atomprop.h
     atoms.h
     block.h
@@ -43,9 +43,8 @@ set(TOPOLOGY_PUBLIC_HEADERS
     index.h
     mtop_util.h
     symtab.h
-    topology.h)
-
-gmx_install_headers(topology ${TOPOLOGY_PUBLIC_HEADERS})
+    topology.h
+    )
 
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
index a27ab151e19b313e819a71578c6151f9d336b931..a60b69a9241c917c179d4e24c7dc767fd7acc8cb 100644 (file)
 file(GLOB TRAJECTORYANALYSIS_SOURCES *.cpp modules/*.cpp modules/*.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TRAJECTORYANALYSIS_SOURCES} PARENT_SCOPE)
 
-set(TRAJECTORYANALYSIS_PUBLIC_HEADERS
+gmx_install_headers(
     analysismodule.h
     analysissettings.h
-    cmdlinerunner.h)
-gmx_install_headers(trajectoryanalysis ${TRAJECTORYANALYSIS_PUBLIC_HEADERS})
+    cmdlinerunner.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index b08dcfc5ab30e755ad4f1dfb754ad29edec2eb77..a478811e40c4c10e0cb3db4c00aa9da2e9090569 100644 (file)
@@ -35,7 +35,7 @@
 file(GLOB UTILITY_SOURCES *.c *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${UTILITY_SOURCES} PARENT_SCOPE)
 
-set(UTILITY_PUBLIC_HEADERS
+gmx_install_headers(
     arrayref.h
     basedefinitions.h
     cstringutil.h
@@ -54,7 +54,6 @@ set(UTILITY_PUBLIC_HEADERS
     smalloc.h
     stringutil.h
     )
-gmx_install_headers(utility ${UTILITY_PUBLIC_HEADERS})
 
 if (BUILD_TESTING)
     add_subdirectory(tests)