diff options
-rw-r--r-- | Modules/GNUInstallDirs.cmake | 44 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/Common.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/Root-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt | 2 |
6 files changed, 35 insertions, 18 deletions
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index 9599f270cc..64bd09e686 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -45,6 +45,8 @@ # modifiable architecture-independent data (``com``) # ``LOCALSTATEDIR`` # modifiable single-machine data (``var``) +# ``RUNSTATEDIR`` +# run-time variable data (``LOCALSTATEDIR/run``) # ``LIBDIR`` # object code libraries (``lib`` or ``lib64`` # or ``lib/<multiarch-tuple>`` on Debian) @@ -75,10 +77,10 @@ # # ``/`` # -# For ``<dir>`` other than the ``SYSCONFDIR`` and ``LOCALSTATEDIR``, -# the value of ``CMAKE_INSTALL_<dir>`` is prefixed with ``usr/`` if -# it is not user-specified as an absolute path. For example, the -# ``INCLUDEDIR`` value ``include`` becomes ``usr/include``. +# For ``<dir>`` other than the ``SYSCONFDIR``, ``LOCALSTATEDIR`` and +# ``RUNSTATEDIR``, the value of ``CMAKE_INSTALL_<dir>`` is prefixed +# with ``usr/`` if it is not user-specified as an absolute path. +# For example, the ``INCLUDEDIR`` value ``include`` becomes ``usr/include``. # This is required by the `GNU Coding Standards`_, which state: # # When building the complete GNU system, the prefix will be empty @@ -86,20 +88,21 @@ # # ``/usr`` # -# For ``<dir>`` equal to ``SYSCONFDIR`` or ``LOCALSTATEDIR``, the -# ``CMAKE_INSTALL_FULL_<dir>`` is computed by prepending just ``/`` -# to the value of ``CMAKE_INSTALL_<dir>`` if it is not user-specified -# as an absolute path. For example, the ``SYSCONFDIR`` value ``etc`` -# becomes ``/etc``. This is required by the `GNU Coding Standards`_. +# For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or +# ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by +# prepending just ``/`` to the value of ``CMAKE_INSTALL_<dir>`` +# if it is not user-specified as an absolute path. +# For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc``. +# This is required by the `GNU Coding Standards`_. # # ``/opt/...`` # -# For ``<dir>`` equal to ``SYSCONFDIR`` or ``LOCALSTATEDIR``, the -# ``CMAKE_INSTALL_FULL_<dir>`` is computed by *appending* the prefix -# to the value of ``CMAKE_INSTALL_<dir>`` if it is not user-specified -# as an absolute path. For example, the ``SYSCONFDIR`` value ``etc`` -# becomes ``/etc/opt/...``. This is defined by the -# `Filesystem Hierarchy Standard`_. +# For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or +# ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by +# *appending* the prefix to the value of ``CMAKE_INSTALL_<dir>`` +# if it is not user-specified as an absolute path. +# For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc/opt/...``. +# This is defined by the `Filesystem Hierarchy Standard`_. # # .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html # @@ -287,6 +290,9 @@ _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DAT _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}" "Documentation root (DATAROOTDIR/doc/PROJECT_NAME)") +_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_RUNSTATEDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/run" + "Run-time variable data (LOCALSTATEDIR/run)") + #----------------------------------------------------------------------------- mark_as_advanced( @@ -296,6 +302,7 @@ mark_as_advanced( CMAKE_INSTALL_SYSCONFDIR CMAKE_INSTALL_SHAREDSTATEDIR CMAKE_INSTALL_LOCALSTATEDIR + CMAKE_INSTALL_RUNSTATEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_OLDINCLUDEDIR @@ -314,7 +321,7 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var) # - CMAKE_INSTALL_PREFIX == /usr # - CMAKE_INSTALL_PREFIX == /opt/... if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/") - if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR") + if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR") set(${absvar} "/${${var}}") else() if (NOT "${${var}}" MATCHES "^usr/") @@ -323,13 +330,13 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var) set(${absvar} "/${${var}}") endif() elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$") - if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR") + if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR") set(${absvar} "/${${var}}") else() set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}") endif() elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/.*") - if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR") + if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR") set(${absvar} "/${${var}}${CMAKE_INSTALL_PREFIX}") else() set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}") @@ -351,6 +358,7 @@ foreach(dir SYSCONFDIR SHAREDSTATEDIR LOCALSTATEDIR + RUNSTATEDIR LIBDIR INCLUDEDIR OLDINCLUDEDIR diff --git a/Tests/RunCMake/GNUInstallDirs/Common.cmake b/Tests/RunCMake/GNUInstallDirs/Common.cmake index eff2d54b3c..5f119af999 100644 --- a/Tests/RunCMake/GNUInstallDirs/Common.cmake +++ b/Tests/RunCMake/GNUInstallDirs/Common.cmake @@ -15,6 +15,7 @@ set(dirs LIBEXECDIR LOCALEDIR LOCALSTATEDIR + RUNSTATEDIR MANDIR SBINDIR SHAREDSTATEDIR diff --git a/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt index aee8552c8d..3e1841060f 100644 --- a/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Opt-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64)' CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='share/man' CMAKE_INSTALL_SBINDIR='sbin' CMAKE_INSTALL_SHAREDSTATEDIR='com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/opt/Opt/(lib|lib64)' CMAKE_INSTALL_FULL_LIBEXECDIR='/opt/Opt/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/opt/Opt/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var/opt/Opt' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run/opt/Opt' CMAKE_INSTALL_FULL_MANDIR='/opt/Opt/share/man' CMAKE_INSTALL_FULL_SBINDIR='/opt/Opt/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/opt/Opt/com' diff --git a/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt index a95400e862..8c133681f1 100644 --- a/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Root-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='usr/(lib|lib64)' CMAKE_INSTALL_LIBEXECDIR='usr/libexec' CMAKE_INSTALL_LOCALEDIR='usr/share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='usr/share/man' CMAKE_INSTALL_SBINDIR='usr/sbin' CMAKE_INSTALL_SHAREDSTATEDIR='usr/com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64)' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run' CMAKE_INSTALL_FULL_MANDIR='/usr/share/man' CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com' diff --git a/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt index e10c4c5956..a591436bae 100644 --- a/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/Usr-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64|lib/arch)' CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='share/man' CMAKE_INSTALL_SBINDIR='sbin' CMAKE_INSTALL_SHAREDSTATEDIR='com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64|lib/arch)' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run' CMAKE_INSTALL_FULL_MANDIR='/usr/share/man' CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com' diff --git a/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt b/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt index 8dcf25b6e2..f957e0e538 100644 --- a/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt +++ b/Tests/RunCMake/GNUInstallDirs/UsrLocal-stderr.txt @@ -8,6 +8,7 @@ CMAKE_INSTALL_LIBDIR='(lib|lib64)' CMAKE_INSTALL_LIBEXECDIR='libexec' CMAKE_INSTALL_LOCALEDIR='share/locale' CMAKE_INSTALL_LOCALSTATEDIR='var' +CMAKE_INSTALL_RUNSTATEDIR='var/run' CMAKE_INSTALL_MANDIR='share/man' CMAKE_INSTALL_SBINDIR='sbin' CMAKE_INSTALL_SHAREDSTATEDIR='com' @@ -22,6 +23,7 @@ CMAKE_INSTALL_FULL_LIBDIR='/usr/local/(lib|lib64)' CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/local/libexec' CMAKE_INSTALL_FULL_LOCALEDIR='/usr/local/share/locale' CMAKE_INSTALL_FULL_LOCALSTATEDIR='/usr/local/var' +CMAKE_INSTALL_FULL_RUNSTATEDIR='/usr/local/var/run' CMAKE_INSTALL_FULL_MANDIR='/usr/local/share/man' CMAKE_INSTALL_FULL_SBINDIR='/usr/local/sbin' CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/local/com' |