Define GNU standard installation directories
Provides install directory variables as defined by the GNU Coding Standards.
Inclusion of this module defines the following variables:
CMAKE_INSTALL_<dir>
Destination for files of a given type. This value may be passed to theDESTINATION
options ofinstall()
commands for the corresponding file type.
CMAKE_INSTALL_FULL_<dir>
The absolute path generated from the correspondingCMAKE_INSTALL_<dir>
value. If the value is not already an absolute path, an absolute path is constructed typically by prepending the value of theCMAKE_INSTALL_PREFIX
variable. However, there are some special cases as documented below.
where <dir>
is one of:
BINDIR
bin
)SBINDIR
sbin
)LIBEXECDIR
libexec
)SYSCONFDIR
etc
)SHAREDSTATEDIR
com
)LOCALSTATEDIR
var
)LIBDIR
lib
or lib64
or lib/<multiarch-tuple>
on Debian)INCLUDEDIR
include
)OLDINCLUDEDIR
/usr/include
)DATAROOTDIR
share
)DATADIR
DATAROOTDIR
)INFODIR
DATAROOTDIR/info
)LOCALEDIR
DATAROOTDIR/locale
)MANDIR
DATAROOTDIR/man
)DOCDIR
DATAROOTDIR/doc/PROJECT_NAME
)If the includer does not define a value the above-shown default will be used and the value will appear in the cache for editing by the user.
The following values of CMAKE_INSTALL_PREFIX
are special:
/
For
<dir>
other than theSYSCONFDIR
andLOCALSTATEDIR
, the value ofCMAKE_INSTALL_<dir>
is prefixed withusr/
if it is not user-specified as an absolute path. For example, theINCLUDEDIR
valueinclude
becomesusr/include
. This is required by the GNU Coding Standards, which state:When building the complete GNU system, the prefix will be empty and/usr
will be a symbolic link to/
.
/usr
For<dir>
equal toSYSCONFDIR
orLOCALSTATEDIR
, theCMAKE_INSTALL_FULL_<dir>
is computed by prepending just/
to the value ofCMAKE_INSTALL_<dir>
if it is not user-specified as an absolute path. For example, theSYSCONFDIR
valueetc
becomes/etc
. This is required by the GNU Coding Standards.
/opt/...
For<dir>
equal toSYSCONFDIR
orLOCALSTATEDIR
, theCMAKE_INSTALL_FULL_<dir>
is computed by appending the prefix to the value ofCMAKE_INSTALL_<dir>
if it is not user-specified as an absolute path. For example, theSYSCONFDIR
valueetc
becomes/etc/opt/...
. This is defined by the Filesystem Hierarchy Standard.
© 2000–2016 Kitware, Inc.
© 2000–2011 Insight Software Consortium
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.5/module/GNUInstallDirs.html