GNUInstallDirs.cmake 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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)
  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.
  30. #=============================================================================
  31. # Copyright 2011 Nikita Krupen'ko <[email protected]>
  32. # Copyright 2011 Kitware, Inc.
  33. #
  34. # Distributed under the OSI-approved BSD License (the "License");
  35. # see accompanying file Copyright.txt for details.
  36. #
  37. # This software is distributed WITHOUT ANY WARRANTY; without even the
  38. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  39. # See the License for more information.
  40. #=============================================================================
  41. # (To distribute this file outside of CMake, substitute the full
  42. # License text for the above reference.)
  43. # Installation directories
  44. #
  45. if(NOT DEFINED CMAKE_INSTALL_BINDIR)
  46. set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
  47. endif()
  48. if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
  49. set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
  50. endif()
  51. if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
  52. set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
  53. endif()
  54. if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
  55. set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
  56. endif()
  57. if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
  58. set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
  59. endif()
  60. if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
  61. set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
  62. endif()
  63. if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
  64. set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "object code libraries (lib)")
  65. endif()
  66. if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
  67. set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
  68. endif()
  69. if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
  70. set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
  71. endif()
  72. if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
  73. set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
  74. endif()
  75. if(NOT DEFINED CMAKE_INSTALL_DATADIR)
  76. set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
  77. endif()
  78. if(NOT DEFINED CMAKE_INSTALL_INFODIR)
  79. set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info" CACHE PATH "info documentation (DATAROOTDIR/info)")
  80. endif()
  81. if(NOT DEFINED CMAKE_INSTALL_LOCALEDIR)
  82. set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
  83. endif()
  84. if(NOT DEFINED CMAKE_INSTALL_MANDIR)
  85. set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man" CACHE PATH "man documentation (DATAROOTDIR/man)")
  86. endif()
  87. if(NOT DEFINED CMAKE_INSTALL_DOCDIR)
  88. set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
  89. endif()
  90. mark_as_advanced(
  91. CMAKE_INSTALL_BINDIR
  92. CMAKE_INSTALL_SBINDIR
  93. CMAKE_INSTALL_LIBEXECDIR
  94. CMAKE_INSTALL_SYSCONFDIR
  95. CMAKE_INSTALL_SHAREDSTATEDIR
  96. CMAKE_INSTALL_LOCALSTATEDIR
  97. CMAKE_INSTALL_LIBDIR
  98. CMAKE_INSTALL_INCLUDEDIR
  99. CMAKE_INSTALL_OLDINCLUDEDIR
  100. CMAKE_INSTALL_DATAROOTDIR
  101. CMAKE_INSTALL_DATADIR
  102. CMAKE_INSTALL_INFODIR
  103. CMAKE_INSTALL_LOCALEDIR
  104. CMAKE_INSTALL_MANDIR
  105. CMAKE_INSTALL_DOCDIR
  106. )
  107. # Result directories
  108. #
  109. foreach(dir
  110. BINDIR
  111. SBINDIR
  112. LIBEXECDIR
  113. SYSCONFDIR
  114. SHAREDSTATEDIR
  115. LOCALSTATEDIR
  116. LIBDIR
  117. INCLUDEDIR
  118. OLDINCLUDEDIR
  119. DATAROOTDIR
  120. DATADIR
  121. INFODIR
  122. LOCALEDIR
  123. MANDIR
  124. DOCDIR
  125. )
  126. if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
  127. set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
  128. else()
  129. set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
  130. endif()
  131. endforeach()