GNUInstallDirs.cmake 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. GNUInstallDirs
  5. --------------
  6. Define GNU standard installation directories
  7. Provides install directory variables as defined by the
  8. `GNU Coding Standards`_.
  9. .. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
  10. Result Variables
  11. ^^^^^^^^^^^^^^^^
  12. Inclusion of this module defines the following variables:
  13. ``CMAKE_INSTALL_<dir>``
  14. Destination for files of a given type. This value may be passed to
  15. the ``DESTINATION`` options of :command:`install` commands for the
  16. corresponding file type. It should be a path relative to the installation
  17. prefix so that it can be converted to an absolute path in a relocatable way.
  18. While absolute paths are allowed, they are not recommended as they
  19. do not work with the ``cmake --install`` command's
  20. :option:`--prefix <cmake--install --prefix>` option, or with the
  21. :manual:`cpack <cpack(1)>` installer generators. In particular, there is no
  22. need to make paths absolute by prepending :variable:`CMAKE_INSTALL_PREFIX`;
  23. this prefix is used by default if the DESTINATION is a relative path.
  24. ``CMAKE_INSTALL_FULL_<dir>``
  25. The absolute path generated from the corresponding ``CMAKE_INSTALL_<dir>``
  26. value. If the value is not already an absolute path, an absolute path
  27. is constructed typically by prepending the value of the
  28. :variable:`CMAKE_INSTALL_PREFIX` variable. However, there are some
  29. `special cases`_ as documented below.
  30. These variables shouldn't be used in :command:`install` commands
  31. as they do not work with the ``cmake --install`` command's
  32. :option:`--prefix <cmake--install --prefix>` option, or with the
  33. :manual:`cpack <cpack(1)>` installer generators.
  34. where ``<dir>`` is one of:
  35. ``BINDIR``
  36. user executables (``bin``)
  37. ``SBINDIR``
  38. system admin executables (``sbin``)
  39. ``LIBEXECDIR``
  40. program executables (``libexec``)
  41. ``SYSCONFDIR``
  42. read-only single-machine data (``etc``)
  43. ``SHAREDSTATEDIR``
  44. modifiable architecture-independent data (``com``)
  45. ``LOCALSTATEDIR``
  46. modifiable single-machine data (``var``)
  47. ``RUNSTATEDIR``
  48. .. versionadded:: 3.9
  49. run-time variable data (``LOCALSTATEDIR/run``)
  50. ``LIBDIR``
  51. object code libraries (``lib`` or ``lib64``)
  52. On Debian, this may be ``lib/<multiarch-tuple>`` when
  53. :variable:`CMAKE_INSTALL_PREFIX` is ``/usr``.
  54. ``INCLUDEDIR``
  55. C header files (``include``)
  56. ``OLDINCLUDEDIR``
  57. C header files for non-gcc (``/usr/include``)
  58. ``DATAROOTDIR``
  59. read-only architecture-independent data root (``share``)
  60. ``DATADIR``
  61. read-only architecture-independent data (``DATAROOTDIR``)
  62. ``INFODIR``
  63. info documentation (``DATAROOTDIR/info``)
  64. ``LOCALEDIR``
  65. locale-dependent data (``DATAROOTDIR/locale``)
  66. ``MANDIR``
  67. man documentation (``DATAROOTDIR/man``)
  68. ``DOCDIR``
  69. documentation root (``DATAROOTDIR/doc/PROJECT_NAME``)
  70. If the includer does not define a value the above-shown default will be
  71. used and the value will appear in the cache for editing by the user.
  72. Special Cases
  73. ^^^^^^^^^^^^^
  74. .. versionadded:: 3.4
  75. The following values of :variable:`CMAKE_INSTALL_PREFIX` are special:
  76. ``/``
  77. For ``<dir>`` other than the ``SYSCONFDIR``, ``LOCALSTATEDIR`` and
  78. ``RUNSTATEDIR``, the value of ``CMAKE_INSTALL_<dir>`` is prefixed
  79. with ``usr/`` if it is not user-specified as an absolute path.
  80. For example, the ``INCLUDEDIR`` value ``include`` becomes ``usr/include``.
  81. This is required by the `GNU Coding Standards`_, which state:
  82. When building the complete GNU system, the prefix will be empty
  83. and ``/usr`` will be a symbolic link to ``/``.
  84. ``/usr``
  85. For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
  86. ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
  87. prepending just ``/`` to the value of ``CMAKE_INSTALL_<dir>``
  88. if it is not user-specified as an absolute path.
  89. For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc``.
  90. This is required by the `GNU Coding Standards`_.
  91. ``/opt/...``
  92. For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
  93. ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
  94. *appending* the prefix to the value of ``CMAKE_INSTALL_<dir>``
  95. if it is not user-specified as an absolute path.
  96. For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc/opt/...``.
  97. This is defined by the `Filesystem Hierarchy Standard`_.
  98. This behavior does not apply to paths under ``/opt/homebrew/...``.
  99. .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
  100. Macros
  101. ^^^^^^
  102. .. command:: GNUInstallDirs_get_absolute_install_dir
  103. ::
  104. GNUInstallDirs_get_absolute_install_dir(absvar var dirname)
  105. .. versionadded:: 3.7
  106. Set the given variable ``absvar`` to the absolute path contained
  107. within the variable ``var``. This is to allow the computation of an
  108. absolute path, accounting for all the special cases documented
  109. above. While this macro is used to compute the various
  110. ``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
  111. allow users who create additional path variables to also compute
  112. absolute paths where necessary, using the same logic. ``dirname`` is
  113. the directory name to get, e.g. ``BINDIR``.
  114. .. versionchanged:: 3.20
  115. Added the ``<dirname>`` parameter. Previous versions of CMake passed
  116. this value through the variable ``${dir}``.
  117. #]=======================================================================]
  118. cmake_policy(PUSH)
  119. cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
  120. # Convert a cache variable to PATH type
  121. macro(_GNUInstallDirs_cache_convert_to_path var description)
  122. get_property(_GNUInstallDirs_cache_type CACHE ${var} PROPERTY TYPE)
  123. if(_GNUInstallDirs_cache_type STREQUAL "UNINITIALIZED")
  124. file(TO_CMAKE_PATH "${${var}}" _GNUInstallDirs_cmakepath)
  125. set_property(CACHE ${var} PROPERTY TYPE PATH)
  126. set_property(CACHE ${var} PROPERTY VALUE "${_GNUInstallDirs_cmakepath}")
  127. set_property(CACHE ${var} PROPERTY HELPSTRING "${description}")
  128. unset(_GNUInstallDirs_cmakepath)
  129. endif()
  130. unset(_GNUInstallDirs_cache_type)
  131. endmacro()
  132. # Create a cache variable with default for a path.
  133. macro(_GNUInstallDirs_cache_path var default description)
  134. if(NOT DEFINED ${var})
  135. set(${var} "${default}" CACHE PATH "${description}")
  136. endif()
  137. _GNUInstallDirs_cache_convert_to_path("${var}" "${description}")
  138. endmacro()
  139. # Create a cache variable with not default for a path, with a fallback
  140. # when unset; used for entries slaved to other entries such as
  141. # DATAROOTDIR.
  142. macro(_GNUInstallDirs_cache_path_fallback var default description)
  143. if(NOT ${var})
  144. set(${var} "" CACHE PATH "${description}")
  145. set(${var} "${default}")
  146. endif()
  147. _GNUInstallDirs_cache_convert_to_path("${var}" "${description}")
  148. endmacro()
  149. # Installation directories
  150. #
  151. _GNUInstallDirs_cache_path(CMAKE_INSTALL_BINDIR "bin"
  152. "User executables (bin)")
  153. _GNUInstallDirs_cache_path(CMAKE_INSTALL_SBINDIR "sbin"
  154. "System admin executables (sbin)")
  155. _GNUInstallDirs_cache_path(CMAKE_INSTALL_LIBEXECDIR "libexec"
  156. "Program executables (libexec)")
  157. _GNUInstallDirs_cache_path(CMAKE_INSTALL_SYSCONFDIR "etc"
  158. "Read-only single-machine data (etc)")
  159. _GNUInstallDirs_cache_path(CMAKE_INSTALL_SHAREDSTATEDIR "com"
  160. "Modifiable architecture-independent data (com)")
  161. _GNUInstallDirs_cache_path(CMAKE_INSTALL_LOCALSTATEDIR "var"
  162. "Modifiable single-machine data (var)")
  163. # We check if the variable was manually set and not cached, in order to
  164. # allow projects to set the values as normal variables before including
  165. # GNUInstallDirs to avoid having the entries cached or user-editable. It
  166. # replaces the "if(NOT DEFINED CMAKE_INSTALL_XXX)" checks in all the
  167. # other cases.
  168. # If CMAKE_INSTALL_LIBDIR is defined, if _libdir_set is false, then the
  169. # variable is a normal one, otherwise it is a cache one.
  170. get_property(_libdir_set CACHE CMAKE_INSTALL_LIBDIR PROPERTY TYPE SET)
  171. if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set
  172. AND DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
  173. AND NOT "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" STREQUAL "${CMAKE_INSTALL_PREFIX}"))
  174. # If CMAKE_INSTALL_LIBDIR is not defined, it is always executed.
  175. # Otherwise:
  176. # * if _libdir_set is false it is not executed (meaning that it is
  177. # not a cache variable)
  178. # * if _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX is not defined it is
  179. # not executed
  180. # * if _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX and
  181. # CMAKE_INSTALL_PREFIX are the same string it is not executed.
  182. # _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX is updated after the
  183. # execution, of this part of code, therefore at the next inclusion
  184. # of the file, CMAKE_INSTALL_LIBDIR is defined, and the 2 strings
  185. # are equal, meaning that the if is not executed the code the
  186. # second time.
  187. set(_LIBDIR_DEFAULT "lib")
  188. # Override this default 'lib' with 'lib64' iff:
  189. # - we are on Linux system but NOT cross-compiling
  190. # - we are NOT on debian
  191. # - we are NOT building for conda
  192. # - we are on a 64 bits system
  193. # reason is: amd64 ABI: https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI
  194. # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
  195. # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
  196. # and CMAKE_INSTALL_PREFIX is "/usr"
  197. # See http://wiki.debian.org/Multiarch
  198. if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
  199. set(__LAST_LIBDIR_DEFAULT "lib")
  200. # __LAST_LIBDIR_DEFAULT is the default value that we compute from
  201. # _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX, not a cache entry for
  202. # the value that was last used as the default.
  203. # This value is used to figure out whether the user changed the
  204. # CMAKE_INSTALL_LIBDIR value manually, or if the value was the
  205. # default one. When CMAKE_INSTALL_PREFIX changes, the value is
  206. # updated to the new default, unless the user explicitly changed it.
  207. endif()
  208. if (NOT DEFINED CMAKE_SYSTEM_NAME OR NOT DEFINED CMAKE_SIZEOF_VOID_P)
  209. message(AUTHOR_WARNING
  210. "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
  211. "Please enable at least one language before including GNUInstallDirs.")
  212. endif()
  213. if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
  214. AND NOT CMAKE_CROSSCOMPILING)
  215. unset(__system_type_for_install)
  216. if(DEFINED ENV{CONDA_BUILD} AND DEFINED ENV{PREFIX})
  217. set(conda_prefix "$ENV{PREFIX}")
  218. cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
  219. if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix)
  220. set(__system_type_for_install "conda")
  221. endif()
  222. elseif(DEFINED ENV{CONDA_PREFIX})
  223. set(conda_prefix "$ENV{CONDA_PREFIX}")
  224. cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
  225. if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix AND
  226. NOT ("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$" OR
  227. "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$"))
  228. set(__system_type_for_install "conda")
  229. endif()
  230. endif()
  231. if(NOT __system_type_for_install)
  232. if (EXISTS "/etc/alpine-release")
  233. set(__system_type_for_install "alpine")
  234. elseif (EXISTS "/etc/arch-release")
  235. set(__system_type_for_install "arch linux")
  236. elseif (EXISTS "/etc/debian_version")
  237. set(__system_type_for_install "debian")
  238. endif()
  239. endif()
  240. if(__system_type_for_install STREQUAL "debian")
  241. if(CMAKE_LIBRARY_ARCHITECTURE)
  242. if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
  243. set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
  244. endif()
  245. if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
  246. AND "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
  247. set(__LAST_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
  248. endif()
  249. endif()
  250. elseif(NOT DEFINED __system_type_for_install)
  251. # not debian, alpine, arch, or conda so rely on CMAKE_SIZEOF_VOID_P:
  252. if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
  253. set(_LIBDIR_DEFAULT "lib64")
  254. if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
  255. set(__LAST_LIBDIR_DEFAULT "lib64")
  256. endif()
  257. endif()
  258. endif()
  259. endif()
  260. unset(__system_type_for_install)
  261. if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
  262. set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "Object code libraries (${_LIBDIR_DEFAULT})")
  263. elseif(DEFINED __LAST_LIBDIR_DEFAULT
  264. AND "${__LAST_LIBDIR_DEFAULT}" STREQUAL "${CMAKE_INSTALL_LIBDIR}")
  265. set_property(CACHE CMAKE_INSTALL_LIBDIR PROPERTY VALUE "${_LIBDIR_DEFAULT}")
  266. endif()
  267. endif()
  268. _GNUInstallDirs_cache_convert_to_path(CMAKE_INSTALL_LIBDIR "Object code libraries (lib)")
  269. # Save for next run
  270. set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "CMAKE_INSTALL_PREFIX during last run")
  271. unset(_libdir_set)
  272. unset(__LAST_LIBDIR_DEFAULT)
  273. _GNUInstallDirs_cache_path(CMAKE_INSTALL_INCLUDEDIR "include"
  274. "C header files (include)")
  275. _GNUInstallDirs_cache_path(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include"
  276. "C header files for non-gcc (/usr/include)")
  277. _GNUInstallDirs_cache_path(CMAKE_INSTALL_DATAROOTDIR "share"
  278. "Read-only architecture-independent data root (share)")
  279. #-----------------------------------------------------------------------------
  280. # Values whose defaults are relative to DATAROOTDIR. Store empty values in
  281. # the cache and store the defaults in local variables if the cache values are
  282. # not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
  283. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}"
  284. "Read-only architecture-independent data (DATAROOTDIR)")
  285. if(CMAKE_SYSTEM_NAME MATCHES "^(([^kF].*)?BSD|DragonFly)$")
  286. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "info"
  287. "Info documentation (info)")
  288. else()
  289. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info"
  290. "Info documentation (DATAROOTDIR/info)")
  291. endif()
  292. if(CMAKE_SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$" AND NOT CMAKE_SYSTEM_NAME MATCHES "^(FreeBSD)$")
  293. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "man"
  294. "Man documentation (man)")
  295. else()
  296. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man"
  297. "Man documentation (DATAROOTDIR/man)")
  298. endif()
  299. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale"
  300. "Locale-dependent data (DATAROOTDIR/locale)")
  301. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}"
  302. "Documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
  303. _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_RUNSTATEDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/run"
  304. "Run-time variable data (LOCALSTATEDIR/run)")
  305. #-----------------------------------------------------------------------------
  306. mark_as_advanced(
  307. CMAKE_INSTALL_BINDIR
  308. CMAKE_INSTALL_SBINDIR
  309. CMAKE_INSTALL_LIBEXECDIR
  310. CMAKE_INSTALL_SYSCONFDIR
  311. CMAKE_INSTALL_SHAREDSTATEDIR
  312. CMAKE_INSTALL_LOCALSTATEDIR
  313. CMAKE_INSTALL_RUNSTATEDIR
  314. CMAKE_INSTALL_LIBDIR
  315. CMAKE_INSTALL_INCLUDEDIR
  316. CMAKE_INSTALL_OLDINCLUDEDIR
  317. CMAKE_INSTALL_DATAROOTDIR
  318. CMAKE_INSTALL_DATADIR
  319. CMAKE_INSTALL_INFODIR
  320. CMAKE_INSTALL_LOCALEDIR
  321. CMAKE_INSTALL_MANDIR
  322. CMAKE_INSTALL_DOCDIR
  323. )
  324. macro(GNUInstallDirs_get_absolute_install_dir absvar var)
  325. set(GGAID_extra_args ${ARGN})
  326. list(LENGTH GGAID_extra_args GGAID_extra_arg_count)
  327. if(GGAID_extra_arg_count GREATER "0")
  328. list(GET GGAID_extra_args 0 GGAID_dir)
  329. else()
  330. # Historical behavior: use ${dir} from caller's scope
  331. set(GGAID_dir "${dir}")
  332. message(AUTHOR_WARNING
  333. "GNUInstallDirs_get_absolute_install_dir called without third argument. "
  334. "Using \${dir} from the caller's scope for compatibility with CMake 3.19 and below.")
  335. endif()
  336. if(NOT IS_ABSOLUTE "${${var}}")
  337. # Handle special cases:
  338. # - CMAKE_INSTALL_PREFIX == /
  339. # - CMAKE_INSTALL_PREFIX == /usr
  340. # - CMAKE_INSTALL_PREFIX == /opt/...
  341. if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
  342. if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
  343. set(${absvar} "/${${var}}")
  344. else()
  345. if (NOT "${${var}}" MATCHES "^usr/")
  346. set(${var} "usr/${${var}}")
  347. endif()
  348. set(${absvar} "/${${var}}")
  349. endif()
  350. elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
  351. if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
  352. set(${absvar} "/${${var}}")
  353. else()
  354. set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
  355. endif()
  356. elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/" AND NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/homebrew/")
  357. if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
  358. set(${absvar} "/${${var}}${CMAKE_INSTALL_PREFIX}")
  359. else()
  360. set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
  361. endif()
  362. else()
  363. set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
  364. endif()
  365. else()
  366. set(${absvar} "${${var}}")
  367. endif()
  368. unset(GGAID_dir)
  369. unset(GGAID_extra_arg_count)
  370. unset(GGAID_extra_args)
  371. endmacro()
  372. # Result directories
  373. #
  374. foreach(dir
  375. BINDIR
  376. SBINDIR
  377. LIBEXECDIR
  378. SYSCONFDIR
  379. SHAREDSTATEDIR
  380. LOCALSTATEDIR
  381. RUNSTATEDIR
  382. LIBDIR
  383. INCLUDEDIR
  384. OLDINCLUDEDIR
  385. DATAROOTDIR
  386. DATADIR
  387. INFODIR
  388. LOCALEDIR
  389. MANDIR
  390. DOCDIR
  391. )
  392. GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_${dir} CMAKE_INSTALL_${dir} ${dir})
  393. endforeach()
  394. cmake_policy(POP)