Commit 40814a7c authored by Felix Geyer's avatar Felix Geyer

GNUInstallDirs: Add RUNSTATEDIR variable

parent 286e4f10
......@@ -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
......
......@@ -15,6 +15,7 @@ set(dirs
LIBEXECDIR
LOCALEDIR
LOCALSTATEDIR
RUNSTATEDIR
MANDIR
SBINDIR
SHAREDSTATEDIR
......
......@@ -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'
......
......@@ -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'
......
......@@ -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'
......
......@@ -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'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment