Use default CMake path variables
authorErik Lindahl <erik@kth.se>
Fri, 11 May 2018 14:06:59 +0000 (16:06 +0200)
committerErik Lindahl <erik.lindahl@gmail.com>
Wed, 6 Jun 2018 10:51:13 +0000 (12:51 +0200)
Remove our homegrown path variables for binaries, libraries,
manpages and data in favor of the ones documented as part of CMake.
The 'gromacs' part of the data directory has been moved to a separate
GMX_INSTALL_DATASUBDIR variable.

This enables Gromacs-2018 docker builds with multiple different
accelerations installed with different binary/library subdirectories.

Change-Id: I1618428c94ea2cfb90dc1ff5261b26a9307c1a94

22 files changed:
CMakeLists.txt
admin/copyright.py
docs/CMakeLists.txt
docs/dev-manual/build-system.rst
docs/dev-manual/relocatable-binaries.rst
docs/install-guide/index.rst
scripts/CMakeLists.txt
scripts/GMXRC.bash.cmakein
scripts/GMXRC.cmakein
scripts/GMXRC.csh.cmakein
scripts/GMXRC.zsh.cmakein
share/CMakeLists.txt
share/template/CMakeLists.txt
src/buildinfo.h.cmakein
src/config.h.cmakein
src/gromacs/CMakeLists.txt
src/gromacs/InstallLibInfo.cmake
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/gpu_utils/ocl_compiler.cpp
src/gromacs/libgromacs.pc.cmakein
src/gromacs/utility/datafilefinder.cpp
src/programs/CMakeLists.txt

index 73469b7703e21ce8d266813e7881150616603e8c..ef9be348b34205f1e8c32cbf04682403236ab315 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, 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.
@@ -808,36 +808,28 @@ else()
     set(GMX_SHARED_LINKER_FLAGS ${GMX_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS})
 endif()
 
+
 ########################################################################
 # Specify install locations
 ########################################################################
 # Use GNUInstallDirs to set paths on multiarch systems.
 include(GNUInstallDirs)
 
-# Customization for the installation tree paths.
-set(GMX_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
-    "Library installation directory (default: ${CMAKE_INSTALL_LIBDIR})")
-set(GMX_DATA_INSTALL_DIR gromacs CACHE STRING
-    "Data installation directory under share/ (default: gromacs)")
-mark_as_advanced(GMX_LIB_INSTALL_DIR GMX_DATA_INSTALL_DIR)
-
-# These variables are used internally to provide a central location for
-# customizing the install locations.
-set(LIB_INSTALL_DIR       ${GMX_LIB_INSTALL_DIR})
-set(BIN_INSTALL_DIR       bin)
-# This variable also gets written into config.h for use in finding the data
-# directories.
-set(DATA_INSTALL_DIR      share/${GMX_DATA_INSTALL_DIR})
-set(MAN_INSTALL_DIR       share/man)
+set(GMX_INSTALL_DATASUBDIR "gromacs" CACHE STRING "Subdirectory for GROMACS data under CMAKE_INSTALL_DATADIR")
+mark_as_advanced(GMX_INSTALL_DATASUBDIR)
+
+# Internal convenience so we do not have to join two path segments in the code
+set(GMX_INSTALL_GMXDATADIR ${CMAKE_INSTALL_DATADIR}/${GMX_INSTALL_DATASUBDIR})
+
 # If the nesting level wrt. the installation root is changed,
 # gromacs-config.cmake.cmakein needs to be adapted.
-set(CMAKE_INSTALL_DIR     share/cmake)
+set(GMX_INSTALL_CMAKEDIR  ${CMAKE_INSTALL_DATAROOTDIR}/cmake)
+
 # TODO: Make GMXRC adapt if this is changed
-set(PKGCONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/pkgconfig)
-set(OCL_INSTALL_DIR       ${DATA_INSTALL_DIR}/opencl)
-set(INCL_INSTALL_DIR      include)
+set(GMX_INSTALL_PKGCONFIGDIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+set(GMX_INSTALL_OCLDIR       ${GMX_INSTALL_GMXDATADIR}/opencl)
 
-list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${INCL_INSTALL_DIR})
+list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${CMAKE_INSTALL_INCLUDEDIR})
 
 # Binary and library suffix options
 include(gmxManageSuffixes)
@@ -855,7 +847,7 @@ else()
     # install to lib/, then the installation RPATH works also in the build
     # tree.  This makes installation slightly faster (no need to rewrite the
     # RPATHs), and makes the binaries in the build tree relocatable.
-    if(GMX_LIB_INSTALL_DIR STREQUAL "lib")
+    if(CMAKE_INSTALL_LIBDIR STREQUAL "lib")
         set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
         if(POLICY CMP0068)
             cmake_policy(SET CMP0068 NEW) # From CMake-3.9
@@ -865,10 +857,10 @@ else()
     # Set the RPATH as relative to the executable location to make the
     # binaries relocatable.
     if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") #Assume OS X >=10.5
-        set(CMAKE_INSTALL_RPATH "@executable_path/../${GMX_LIB_INSTALL_DIR}")
+        set(CMAKE_INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR}")
         set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_RPATH})
     else()
-        set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${GMX_LIB_INSTALL_DIR}")
+        set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
     endif()
     set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
     set(CMAKE_MACOSX_RPATH 1)
@@ -876,7 +868,7 @@ endif()
 
 #COPYING file: Only necessary for binary distributions.
 #Simpler to always install.
-install(FILES COPYING DESTINATION ${DATA_INSTALL_DIR} COMPONENT data)
+install(FILES COPYING DESTINATION ${GMX_INSTALL_GMXDATADIR} COMPONENT data)
 
 if (GMX_BUILD_FOR_COVERAGE)
     # Code heavy with asserts makes conditional coverage close to useless metric,
index 1851cb0f8da322c0b0f56a824388901b7a5dfb1c..7e38ed8ab122de90634d4ca555a35b0e1bbc5e72 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 #
 # This file is part of the GROMACS molecular simulation package.
 #
index 3909260f721db62a10001db78af7cb47ce570d86..c8c2ee360d1779f99bad4aa2718260c707b8a33a 100644 (file)
@@ -305,7 +305,7 @@ if (MAN_PAGE_DIR)
     # Trailing slash on directory is significant for
     # install(DIRECTORY). See CMake docs.
     install(DIRECTORY ${MAN_PAGE_DIR}/
-        DESTINATION ${MAN_INSTALL_DIR}/man1
+        DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
         COMPONENT man OPTIONAL
         FILES_MATCHING PATTERN "*.1")
 endif()
index 459a9a737a530df137b81c38035be4afa483f8c4..dd6a69a5a0d7a51b25b2d1933351cf23cb1ff645 100644 (file)
@@ -208,11 +208,12 @@ Variables affecting compilation/linking
    subcounters which are available.
    Defaults to ``OFF``.
 
-.. cmake:: GMX_DATA_INSTALL_DIR
+.. cmake:: GMX_INSTALL_DATASUBDIR
 
-   Sets the directory under :file:`share/` where data files are installed.
-   The default is ``gromacs``, which puts the files under
-   file:`share/gromacs/`.
+   Sets the subdirectory under CMAKE_INSTALL_DATADIR where GROMACS-specific
+   read-only architecture-independent data files are installed. The default
+   is ``gromacs``, which means the files will go under ``share/gromacs``.
+   To alter the ``share`` part, change CMAKE_INSTALL_DATADIR.
    See :doc:`relocatable-binaries` for how this influences the build.
 
 .. cmake:: GMX_DOUBLE
@@ -265,7 +266,7 @@ Variables affecting compilation/linking
 
     Pass additional CUDA-only compiler flags to clang using this variable.
 
-.. cmake:: GMX_LIB_INSTALL_DIR
+.. cmake:: CMAKE_INSTALL_LIBDIR
 
    Sets the installation directory for libraries (default is determined by
    standard CMake package ``GNUInstallDirs``).
index e29907d2d16e9154278c33035b16cb9f204aca76..732bde013f4f021a73b865ed77fc8caecd11c389 100644 (file)
@@ -113,10 +113,10 @@ implementation, which works like this:
    contains :file:`share/{gromacs}/top/gurgle.dat`, this directory is returned
    as the installation prefix.  The file name ``gurgle.dat`` and the location
    are considered unique enough to ensure that the correct directory has been
-   found.  The installation directory for the data files can be customized
-   during CMake configuration by setting ``GMX_DATA_INSTALL_DIR``, which
-   affects the *gromacs* part in the above path (both in the installation
-   structure and in this search logic).
+   found.  The installation directory for read-only architecture-independent
+   data files can be customized during CMake configuration by setting
+   ``CMAKE_INSTALL_DATADIR``, and the subdirectory under this that hosts the
+   GROMACS-specific data is set by ``GMX_INSTALL_DATASUBDIR``.
 
    Note that this search does not resolve symbolic links or normalize the input
    path beforehand: if there are ``..`` components *and* symbolic links in the
index 3d1d8c38d949c7d19864c2df21c7af056c0ae7ad..e46eeecaeb0595a4b58181c2698572d195c6ad7e 100644 (file)
@@ -821,12 +821,14 @@ CMakeLists.txt.
     The standard location for executables and some scripts.
     Some of the scripts hardcode the absolute installation prefix, which needs
     to be changed if the scripts are relocated.
+    The name of the directory can be changed using ``CMAKE_INSTALL_BINDIR`` CMake
+    variable.
 ``include/gromacs/``
     The standard location for installed headers.
 ``lib/``
     The standard location for libraries. The default depends on the system, and
     is determined by CMake.
-    The name of the directory can be changed using ``GMX_LIB_INSTALL_DIR`` CMake
+    The name of the directory can be changed using ``CMAKE_INSTALL_LIBDIR`` CMake
     variable.
 ``lib/pkgconfig/``
     Information about the installed ``libgromacs`` library for ``pkg-config`` is
@@ -836,9 +838,10 @@ CMakeLists.txt.
 ``share/cmake/``
     CMake package configuration files are installed here.
 ``share/gromacs/``
-    Various data files and some documentation go here.
-    The ``gromacs`` part can be changed using ``GMX_DATA_INSTALL_DIR``. Using this
-    CMake variable is the preferred way of changing the installation path for
+    Various data files and some documentation go here. The first part can
+    be changed using ``CMAKE_INSTALL_DATADIR``, and the second by using
+    ``GMX_INSTALL_DATASUBDIR`` Using these CMake variables is the preferred
+    way of changing the installation path for
     ``share/gromacs/top/``, since the path to this directory is built into
     ``libgromacs`` as well as some scripts, both as a relative and as an absolute
     path (the latter as a fallback if everything else fails).
index 521589d2cf432911976e639c4df4107afd720870..43aebd6db8d94d845da34a21ba5a44b15a86f121 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2014, by the GROMACS development team, led by
+# Copyright (c) 2010,2014,2018, 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.
@@ -37,10 +37,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/GMXRC.bash.cmakein ${CMAKE_CURRENT_BI
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/GMXRC.csh.cmakein  ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.csh @ONLY)
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/GMXRC.zsh.cmakein  ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.zsh @ONLY)
 
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC      DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.bash DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.zsh  DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.csh  DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC      DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.bash DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.zsh  DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.csh  DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
 
-install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/demux.pl      DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/xplor2gmx.pl  DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/demux.pl      DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/xplor2gmx.pl  DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
index 18457a637735b89544c46224aacf6a8f68b62f31..7de4e848a8d274677d1f46da51cf651848381cf2 100644 (file)
@@ -51,10 +51,10 @@ MANPATH=$tmppath
 # If you move gromacs, change the first line.
 ##########################################################
 GMXPREFIX=@CMAKE_INSTALL_PREFIX@
-GMXBIN=${GMXPREFIX}/@BIN_INSTALL_DIR@
-GMXLDLIB=${GMXPREFIX}/@LIB_INSTALL_DIR@
-GMXMAN=${GMXPREFIX}/@MAN_INSTALL_DIR@
-GMXDATA=${GMXPREFIX}/@DATA_INSTALL_DIR@
+GMXBIN=${GMXPREFIX}/@CMAKE_INSTALL_BINDIR@
+GMXLDLIB=${GMXPREFIX}/@CMAKE_INSTALL_LIBDIR@
+GMXMAN=${GMXPREFIX}/@CMAKE_INSTALL_MANDIR@
+GMXDATA=${GMXPREFIX}/@GMX_INSTALL_GMXDATADIR@
 GROMACS_DIR=${GMXPREFIX}
 
 LD_LIBRARY_PATH=${GMXLDLIB}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
index 1ecf954885797f38d975eab5204677e8c9e72aeb..c141b2961551f2376d2702c02b7381d7228d37a0 100644 (file)
@@ -10,9 +10,9 @@
 echo $shell | grep -q csh && goto CSH
 
 # if we got here, shell is bsh/bash/zsh/ksh
-. @CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/GMXRC.bash
+. @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/GMXRC.bash
 return
 
 # csh/tcsh jump here
 CSH:
-source @CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/GMXRC.csh
+source @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/GMXRC.csh
index 16a85df5c36adc2263985934f88d57e305ac8bfb..315fccf812edb65bf7f5e95cd8f7824ae2a7301c 100644 (file)
@@ -71,10 +71,10 @@ setenv MANPATH $tmppath
 # If you move gromacs, change the first line.
 ##########################################################
 setenv GMXPREFIX @CMAKE_INSTALL_PREFIX@
-setenv GMXBIN ${GMXPREFIX}/@BIN_INSTALL_DIR@
-setenv GMXLDLIB ${GMXPREFIX}/@LIB_INSTALL_DIR@
-setenv GMXMAN ${GMXPREFIX}/@MAN_INSTALL_DIR@
-setenv GMXDATA ${GMXPREFIX}/@DATA_INSTALL_DIR@
+setenv GMXBIN ${GMXPREFIX}/@CMAKE_INSTALL_BINDIR@
+setenv GMXLDLIB ${GMXPREFIX}/@CMAKE_INSTALL_LIBDIR@
+setenv GMXMAN ${GMXPREFIX}/@CMAKE_INSTALL_MANDIR@
+setenv GMXDATA ${GMXPREFIX}/@GMX_INSTALL_GMXDATADIR@
 setenv GROMACS_DIR ${GMXPREFIX}
 
 #make them begin with :
index 97287547eafc45916006eff57c7bf959dbbb00e5..0558f350a949ca061503c78ac8195f3c06b50f90 100644 (file)
@@ -1,3 +1,3 @@
 # zsh configuration file for Gromacs
 # only kept for backwards compatibility
-source @CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/GMXRC.bash
+source @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/GMXRC.bash
index e82d2d5baa28ace039a4921e7d1fe824c7cd9dc0..29340032591c3b5d6de8ccb5e909b215d147e800 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2018, 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.
@@ -35,9 +35,9 @@
 add_subdirectory(template)
 
 install(FILES README.tutor README_FreeEnergyModifications.txt
-    DESTINATION ${DATA_INSTALL_DIR}
+    DESTINATION ${GMX_INSTALL_GMXDATADIR}
     COMPONENT data)
 install(DIRECTORY top
-    DESTINATION ${DATA_INSTALL_DIR}
+    DESTINATION ${GMX_INSTALL_GMXDATADIR}
     COMPONENT data
     PATTERN "*~" EXCLUDE)
index feee762fddedb3d2089a09543baa423019bda38f..d33e783d9f16af925f6a726ba47482a010bcfde7 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2011,2012,2014,2016, by the GROMACS development team, led by
+# Copyright (c) 2011,2012,2014,2016,2018, 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.
@@ -44,14 +44,14 @@ endif()
 configure_file(README.cmakein README @ONLY)
 
 install(FILES CMakeLists.txt.template
-        DESTINATION ${DATA_INSTALL_DIR}/template
+        DESTINATION ${GMX_INSTALL_GMXDATADIR}/template
         RENAME CMakeLists.txt
         COMPONENT development)
 
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/README template.cpp Makefile.pkg
-        DESTINATION ${DATA_INSTALL_DIR}/template
+        DESTINATION ${GMX_INSTALL_GMXDATADIR}/template
         COMPONENT development)
 
 install(FILES cmake/FindGROMACS.cmake
-        DESTINATION ${DATA_INSTALL_DIR}/template/cmake
+        DESTINATION ${GMX_INSTALL_GMXDATADIR}/template/cmake
         COMPONENT development)
index 21a31e23b30cc861776f29acb8de9d78f1c436d9..1e32a4c3815cb9473c97e390cceb594bec37d8c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, 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.
@@ -87,8 +87,8 @@
 /** Binary directory for the build */
 #define CMAKE_BINARY_DIR        "@CMAKE_BINARY_DIR@"
 
-/** Location of data files in the installation directory */
-#define DATA_INSTALL_DIR        "@DATA_INSTALL_DIR@"
+/** Location of GROMACS-specific data files */
+#define GMX_INSTALL_GMXDATADIR  "@GMX_INSTALL_GMXDATADIR@"
 
 /** CUDA compiler version information */
 #define CUDA_COMPILER_INFO "@CUDA_COMPILER_INFO@"
index bd7e658901cbf87274cd3e1881a21602a9224d79..894338768747e0310b9123f5b61f63b860bf0e26 100644 (file)
 #cmakedefine01 HAVE_NVML
 
 /* Define relative path to OpenCL kernels */
-#define OCL_INSTALL_DIR "@OCL_INSTALL_DIR@"
+#define GMX_INSTALL_OCLDIR "@GMX_INSTALL_OCLDIR@"
 
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #cmakedefine01 HAVE_FSEEKO
index 3fc93c45fd3252efbaf3180fe8e6e7b2ddd05792..2be0593086fb7a281487ea3ff8032e20b1bb73cd 100644 (file)
@@ -61,7 +61,7 @@ function (gmx_install_headers)
     if (NOT GMX_BUILD_MDRUN_ONLY)
         file(RELATIVE_PATH _dest ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_LIST_DIR})
         install(FILES       ${ARGN}
-                DESTINATION "${INCL_INSTALL_DIR}/${_dest}"
+                DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_dest}"
                 COMPONENT   development)
     endif()
     _gmx_add_files_to_property(GMX_INSTALLED_HEADERS ${ARGN})
@@ -226,9 +226,9 @@ gmx_write_installed_header_list()
 if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
     install(TARGETS libgromacs
             EXPORT libgromacs
-            LIBRARY DESTINATION ${LIB_INSTALL_DIR}
-            RUNTIME DESTINATION ${BIN_INSTALL_DIR}
-            ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+            LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
             COMPONENT libraries)
 endif()
 
@@ -247,7 +247,7 @@ if (INSTALL_CUDART_LIB) #can be set manual by user
                 #install also name-links (linker uses those)
                 file(GLOB CUDA_LIBS ${CUDA_LIB}*)
                 install(FILES ${CUDA_LIBS} DESTINATION
-                    ${LIB_INSTALL_DIR} COMPONENT libraries)
+                    ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
             endif()
         endforeach()
     else()
@@ -259,7 +259,7 @@ if(GMX_USE_OPENCL)
     set(OPENCL_KERNELS ${MDLIB_OPENCL_KERNELS})
 
     install(FILES ${OPENCL_KERNELS} DESTINATION
-        ${OCL_INSTALL_DIR} COMPONENT libraries)
+        ${GMX_INSTALL_OCLDIR} COMPONENT libraries)
 endif()
 
 if (BUILD_TESTING)
index ccc12719caa320a661366888750b6fd7a7383d84..af244430e990fe0b9b699edb295d4def410f093b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014,2016, by the GROMACS development team, led by
+# Copyright (c) 2014,2016,2018, 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.
@@ -51,7 +51,7 @@ function (do_pkgconfig)
     configure_file(libgromacs.pc.cmakein
                    libgromacs.pc @ONLY)
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc
-            DESTINATION ${PKGCONFIG_INSTALL_DIR}
+            DESTINATION ${GMX_INSTALL_PKGCONFIGDIR}
             RENAME "libgromacs${GMX_LIBS_SUFFIX}.pc"
             COMPONENT development)
 endfunction()
@@ -60,7 +60,7 @@ function (do_cmake_config)
     # Install everything into a subdirectory, because
     #  1. CMake expects things to be there for CMAKE_PREFIX_PATH to work, and
     #  2. This nicely isolates files for different suffixes from each other.
-    set(CMAKE_PACKAGE_DIR ${CMAKE_INSTALL_DIR}/gromacs${GMX_LIBS_SUFFIX})
+    set(GMX_INSTALL_CMAKEPKGDIR ${GMX_INSTALL_CMAKEDIR}/gromacs${GMX_LIBS_SUFFIX})
 
     # Install import definitions that take care of the library locations and
     # library dependencies.
@@ -70,7 +70,7 @@ function (do_cmake_config)
     endif()
     install(EXPORT libgromacs
             FILE ${EXPORT_FILE_NAME}
-            DESTINATION ${CMAKE_PACKAGE_DIR}
+            DESTINATION ${GMX_INSTALL_CMAKEPKGDIR}
             COMPONENT libraries)
 
     get_filename_component(GROMACS_CXX_COMPILER ${CMAKE_CXX_COMPILER} REALPATH)
@@ -83,11 +83,11 @@ function (do_cmake_config)
     # find_package(GROMACS NAMES gromacs_d) to find them, without also
     # specifying CONFIGS.
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gromacs-config.cmake
-            DESTINATION ${CMAKE_PACKAGE_DIR}
+            DESTINATION ${GMX_INSTALL_CMAKEPKGDIR}
             RENAME "gromacs${GMX_LIBS_SUFFIX}-config.cmake"
             COMPONENT development)
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gromacs-config-version.cmake
-            DESTINATION ${CMAKE_PACKAGE_DIR}
+            DESTINATION ${GMX_INSTALL_CMAKEPKGDIR}
             RENAME "gromacs${GMX_LIBS_SUFFIX}-config-version.cmake"
             COMPONENT development)
 endfunction()
index dc15cd2df794c62a54e233beb15f78305302e9c1..70692bbcb043418b210db37399bd3d8903a9faaa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
@@ -186,7 +186,7 @@ bool isAcceptableLibraryPath(const std::string &path)
  */
 bool isAcceptableLibraryPathPrefix(const std::string &path)
 {
-    std::string testPath = Path::join(path, DATA_INSTALL_DIR, "top");
+    std::string testPath = Path::join(path, GMX_INSTALL_GMXDATADIR, "top");
     if (isAcceptableLibraryPath(testPath))
     {
         return true;
index 950c323fab7c79e87a71ece156046b987a36e117..957c6bc45387d0832fc20d850e6a6addb47cefab 100644 (file)
@@ -229,7 +229,7 @@ getKernelRootPath()
         InstallationPrefixInfo      info           = getProgramContext().installationPrefix();
         std::string                 dataPathSuffix = (info.bSourceLayout ?
                                                       "src/gromacs/mdlib/nbnxn_ocl" :
-                                                      OCL_INSTALL_DIR);
+                                                      GMX_INSTALL_OCLDIR);
         kernelRootPath = Path::join(info.path, dataPathSuffix);
     }
     else
index 228845ea851f409141db4fff1a54405af7e83310..f4caaa51f6e0ab3b0082e217d87f6935df8cca8d 100644 (file)
@@ -1,4 +1,4 @@
-libdir=@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@
+libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
 
 Name: libgromacs@GMX_LIBS_SUFFIX@
 Description: Gromacs library
index 0ebd30a4f503902839fd5485185a25b396f9e21e..dd7c769483bc447c211c8bedb82e69d5ff89f942 100644 (file)
@@ -83,7 +83,7 @@ std::string DataFileFinder::Impl::getDefaultPath()
     if (!isNullOrEmpty(installPrefix.path))
     {
         const char *const dataPath
-            = installPrefix.bSourceLayout ? "share" : DATA_INSTALL_DIR;
+            = installPrefix.bSourceLayout ? "share" : GMX_INSTALL_GMXDATADIR;
         return Path::join(installPrefix.path, dataPath, "top");
     }
     return std::string();
index 81e7e293014bd0b990f8302a17d21feed4fe1029..d56eb87a25503404f17f3cbe7b754fbbcf57290b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2018, 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.
@@ -52,11 +52,11 @@ elseif(GMX_BUILD_MDRUN_ONLY)
     set_target_properties(mdrun PROPERTIES
         OUTPUT_NAME "${BINARY_NAME}"
         COMPILE_FLAGS "${OpenMP_C_FLAGS}")
-    install(TARGETS mdrun DESTINATION ${BIN_INSTALL_DIR} COMPONENT mdrun)
+    install(TARGETS mdrun DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT mdrun)
     file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
          "complete -o nospace -F _gmx_mdrun_compl ${BINARY_NAME}")
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
-            DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+            DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
 else()
     file(GLOB GMX_MAIN_SOURCES gmx.cpp legacymodules.cpp)
     if(GMX_X11)
@@ -81,7 +81,7 @@ else()
         OUTPUT_NAME "${BINARY_NAME}"
         COMPILE_FLAGS "${OpenMP_C_FLAGS}")
     install(TARGETS gmx
-            RUNTIME DESTINATION ${BIN_INSTALL_DIR})
+            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
     ########################
     # Completion generation
@@ -108,11 +108,11 @@ else()
     endif()
     if (SOURCE_IS_SOURCE_DISTRIBUTION OR GMX_BUILD_HELP)
         install(DIRECTORY ${COMPLETION_DIR}/
-                DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime OPTIONAL)
+                DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime OPTIONAL)
         file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
              "complete -o nospace -F _gmx_compl ${BINARY_NAME}")
         install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
-                DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+                DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
     endif()
     gmx_cpack_add_generated_source_directory(completion)