1
# - Define GNU standard installation directories
2
# Provides install directory variables as defined for GNU software:
3
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
4
# Inclusion of this module defines the following variables:
5
# CMAKE_INSTALL_<dir> - destination for files of a given type
6
# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
7
# where <dir> is one of:
8
# BINDIR - user executables (bin)
9
# SBINDIR - system admin executables (sbin)
10
# LIBEXECDIR - program executables (libexec)
11
# SYSCONFDIR - read-only single-machine data (etc)
12
# SHAREDSTATEDIR - modifiable architecture-independent data (com)
13
# LOCALSTATEDIR - modifiable single-machine data (var)
14
# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
15
# INCLUDEDIR - C header files (include)
16
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
17
# DATAROOTDIR - read-only architecture-independent data root (share)
18
# DATADIR - read-only architecture-independent data (DATAROOTDIR)
19
# INFODIR - info documentation (DATAROOTDIR/info)
20
# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
21
# MANDIR - man documentation (DATAROOTDIR/man)
22
# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
23
# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
24
# install() commands for the corresponding file type. If the includer does
25
# not define a value the above-shown default will be used and the value will
26
# appear in the cache for editing by the user.
27
# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
28
# from the corresponding destination by prepending (if necessary) the value
29
# of CMAKE_INSTALL_PREFIX.
31
#=============================================================================
32
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
33
# Copyright 2011 Kitware, Inc.
35
# Distributed under the OSI-approved BSD License (the "License");
36
# see accompanying file Copyright.txt for details.
38
# This software is distributed WITHOUT ANY WARRANTY; without even the
39
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
40
# See the License for more information.
41
#=============================================================================
42
# (To distribute this file outside of CMake, substitute the full
43
# License text for the above reference.)
45
# Installation directories
47
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
48
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
51
if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
52
set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
55
if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
56
set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
59
if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
60
set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
63
if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
64
set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
67
if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
68
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
71
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
72
set(_LIBDIR_DEFAULT "lib")
73
# Override this default 'lib' with 'lib64' iff:
74
# - we are on Linux system but NOT cross-compiling
75
# - we are NOT on debian
76
# - we are on a 64 bits system
77
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
78
# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
79
# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
80
# See http://wiki.debian.org/Multiarch
81
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
82
AND NOT CMAKE_CROSSCOMPILING)
83
if (EXISTS "/etc/debian_version") # is this a debian system ?
84
if(CMAKE_LIBRARY_ARCHITECTURE)
85
set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
87
else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
88
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
89
message(AUTHOR_WARNING
90
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
91
"Please enable at least one language before including GNUInstallDirs.")
93
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
94
set(_LIBDIR_DEFAULT "lib64")
99
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
102
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
103
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
106
if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
107
set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
110
if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
111
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
114
#-----------------------------------------------------------------------------
115
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
116
# the cache and store the defaults in local variables if the cache values are
117
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
119
if(NOT CMAKE_INSTALL_DATADIR)
120
set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
121
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
124
if(NOT CMAKE_INSTALL_INFODIR)
125
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
126
set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
129
if(NOT CMAKE_INSTALL_LOCALEDIR)
130
set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
131
set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
134
if(NOT CMAKE_INSTALL_MANDIR)
135
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
136
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
139
if(NOT CMAKE_INSTALL_DOCDIR)
140
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
141
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
144
#-----------------------------------------------------------------------------
148
CMAKE_INSTALL_SBINDIR
149
CMAKE_INSTALL_LIBEXECDIR
150
CMAKE_INSTALL_SYSCONFDIR
151
CMAKE_INSTALL_SHAREDSTATEDIR
152
CMAKE_INSTALL_LOCALSTATEDIR
154
CMAKE_INSTALL_INCLUDEDIR
155
CMAKE_INSTALL_OLDINCLUDEDIR
156
CMAKE_INSTALL_DATAROOTDIR
157
CMAKE_INSTALL_DATADIR
158
CMAKE_INSTALL_INFODIR
159
CMAKE_INSTALL_LOCALEDIR
183
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
184
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
186
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")