install.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. install
  2. -------
  3. .. only:: html
  4. .. contents::
  5. Specify rules to run at install time.
  6. This command accepts several signatures:
  7. * :ref:`install(TARGETS) <install-targets>`
  8. * :ref:`install(FILES|PROGRAMS) <install-files>`
  9. * :ref:`install(DIRECTORY) <install-directory>`
  10. * :ref:`install(SCRIPT|CODE) <install-script>`
  11. * :ref:`install(EXPORT|EXPORT_ANDROID_MK) <install-export>`
  12. Introduction
  13. ^^^^^^^^^^^^
  14. This command generates installation rules for a project. Rules
  15. specified by calls to this command within a source directory are
  16. executed in order during installation. The order across directories
  17. is not defined.
  18. There are multiple signatures for this command. Some of them define
  19. installation options for files and targets. Options common to
  20. multiple signatures are covered here but they are valid only for
  21. signatures that specify them. The common options are:
  22. ``DESTINATION``
  23. Specify the directory on disk to which a file will be installed.
  24. If a full path (with a leading slash or drive letter) is given
  25. it is used directly. If a relative path is given it is interpreted
  26. relative to the value of the :variable:`CMAKE_INSTALL_PREFIX` variable.
  27. The prefix can be relocated at install time using the ``DESTDIR``
  28. mechanism explained in the :variable:`CMAKE_INSTALL_PREFIX` variable
  29. documentation.
  30. ``PERMISSIONS``
  31. Specify permissions for installed files. Valid permissions are
  32. ``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``, ``GROUP_READ``,
  33. ``GROUP_WRITE``, ``GROUP_EXECUTE``, ``WORLD_READ``, ``WORLD_WRITE``,
  34. ``WORLD_EXECUTE``, ``SETUID``, and ``SETGID``. Permissions that do
  35. not make sense on certain platforms are ignored on those platforms.
  36. ``CONFIGURATIONS``
  37. Specify a list of build configurations for which the install rule
  38. applies (Debug, Release, etc.). Note that the values specified for
  39. this option only apply to options listed AFTER the ``CONFIGURATIONS``
  40. option. For example, to set separate install paths for the Debug and
  41. Release configurations, do the following:
  42. .. code-block:: cmake
  43. install(TARGETS target
  44. CONFIGURATIONS Debug
  45. RUNTIME DESTINATION Debug/bin)
  46. install(TARGETS target
  47. CONFIGURATIONS Release
  48. RUNTIME DESTINATION Release/bin)
  49. Note that ``CONFIGURATIONS`` appears BEFORE ``RUNTIME DESTINATION``.
  50. ``COMPONENT``
  51. Specify an installation component name with which the install rule
  52. is associated, such as "runtime" or "development". During
  53. component-specific installation only install rules associated with
  54. the given component name will be executed. During a full installation
  55. all components are installed unless marked with ``EXCLUDE_FROM_ALL``.
  56. If ``COMPONENT`` is not provided a default component "Unspecified" is
  57. created. The default component name may be controlled with the
  58. :variable:`CMAKE_INSTALL_DEFAULT_COMPONENT_NAME` variable.
  59. ``EXCLUDE_FROM_ALL``
  60. Specify that the file is excluded from a full installation and only
  61. installed as part of a component-specific installation
  62. ``RENAME``
  63. Specify a name for an installed file that may be different from the
  64. original file. Renaming is allowed only when a single file is
  65. installed by the command.
  66. ``OPTIONAL``
  67. Specify that it is not an error if the file to be installed does
  68. not exist.
  69. Command signatures that install files may print messages during
  70. installation. Use the :variable:`CMAKE_INSTALL_MESSAGE` variable
  71. to control which messages are printed.
  72. .. _install-targets:
  73. Installing Targets
  74. ^^^^^^^^^^^^^^^^^^
  75. ::
  76. install(TARGETS targets... [EXPORT <export-name>]
  77. [[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE|
  78. PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
  79. [DESTINATION <dir>]
  80. [PERMISSIONS permissions...]
  81. [CONFIGURATIONS [Debug|Release|...]]
  82. [COMPONENT <component>]
  83. [NAMELINK_COMPONENT <component>]
  84. [OPTIONAL] [EXCLUDE_FROM_ALL]
  85. [NAMELINK_ONLY|NAMELINK_SKIP]
  86. ] [...]
  87. [INCLUDES DESTINATION [<dir> ...]]
  88. )
  89. The ``TARGETS`` form specifies rules for installing targets from a
  90. project. There are several kinds of target files that may be installed:
  91. ``ARCHIVE``
  92. Static libraries are treated as ``ARCHIVE`` targets, except those
  93. marked with the ``FRAMEWORK`` property on OS X (see ``FRAMEWORK``
  94. below.) For DLL platforms (all Windows-based systems including
  95. Cygwin), the DLL import library is treated as an ``ARCHIVE`` target.
  96. ``LIBRARY``
  97. Module libraries are always treated as ``LIBRARY`` targets. For non-
  98. DLL platforms shared libraries are treated as ``LIBRARY`` targets,
  99. except those marked with the ``FRAMEWORK`` property on OS X (see
  100. ``FRAMEWORK`` below.)
  101. ``RUNTIME``
  102. Executables are treated as ``RUNTIME`` objects, except those marked
  103. with the ``MACOSX_BUNDLE`` property on OS X (see ``BUNDLE`` below.)
  104. For DLL platforms (all Windows-based systems including Cygwin), the
  105. DLL part of a shared library is treated as a ``RUNTIME`` target.
  106. ``OBJECTS``
  107. Object libraries (a simple group of object files) are always treated
  108. as ``OBJECTS`` targets.
  109. ``FRAMEWORK``
  110. Both static and shared libraries marked with the ``FRAMEWORK``
  111. property are treated as ``FRAMEWORK`` targets on OS X.
  112. ``BUNDLE``
  113. Executables marked with the ``MACOSX_BUNDLE`` property are treated as
  114. ``BUNDLE`` targets on OS X.
  115. ``PUBLIC_HEADER``
  116. Any ``PUBLIC_HEADER`` files associated with a library are installed in
  117. the destination specified by the ``PUBLIC_HEADER`` argument on non-Apple
  118. platforms. Rules defined by this argument are ignored for ``FRAMEWORK``
  119. libraries on Apple platforms because the associated files are installed
  120. into the appropriate locations inside the framework folder. See
  121. :prop_tgt:`PUBLIC_HEADER` for details.
  122. ``PRIVATE_HEADER``
  123. Similar to ``PUBLIC_HEADER``, but for ``PRIVATE_HEADER`` files. See
  124. :prop_tgt:`PRIVATE_HEADER` for details.
  125. ``RESOURCE``
  126. Similar to ``PUBLIC_HEADER`` and ``PRIVATE_HEADER``, but for
  127. ``RESOURCE`` files. See :prop_tgt:`RESOURCE` for details.
  128. For each of these arguments given, the arguments following them only apply
  129. to the target or file type specified in the argument. If none is given, the
  130. installation properties apply to all target types. If only one is given then
  131. only targets of that type will be installed (which can be used to install
  132. just a DLL or just an import library.)
  133. In addition to the common options listed above, each target can accept
  134. the following additional arguments:
  135. ``NAMELINK_COMPONENT``
  136. On some platforms a versioned shared library has a symbolic link such
  137. as::
  138. lib<name>.so -> lib<name>.so.1
  139. where ``lib<name>.so.1`` is the soname of the library and ``lib<name>.so``
  140. is a "namelink" allowing linkers to find the library when given
  141. ``-l<name>``. The ``NAMELINK_COMPONENT`` option is similar to the
  142. ``COMPONENT`` option, but it changes the installation component of a shared
  143. library namelink if one is generated. If not specified, this defaults to the
  144. value of ``COMPONENT``. It is an error to use this parameter outside of a
  145. ``LIBRARY`` block.
  146. Consider the following example:
  147. .. code-block:: cmake
  148. install(TARGETS mylib
  149. LIBRARY
  150. DESTINATION lib
  151. COMPONENT Libraries
  152. NAMELINK_COMPONENT Development
  153. PUBLIC_HEADER
  154. DESTINATION include
  155. COMPONENT Development
  156. )
  157. In this scenario, if you choose to install only the ``Development``
  158. component, both the headers and namelink will be installed without the
  159. library. (If you don't also install the ``Libraries`` component, the
  160. namelink will be a dangling symlink, and projects that link to the library
  161. will have build errors.) If you install only the ``Libraries`` component,
  162. only the library will be installed, without the headers and namelink.
  163. This option is typically used for package managers that have separate
  164. runtime and development packages. For example, on Debian systems, the
  165. library is expected to be in the runtime package, and the headers and
  166. namelink are expected to be in the development package.
  167. See the :prop_tgt:`VERSION` and :prop_tgt:`SOVERSION` target properties for
  168. details on creating versioned shared libraries.
  169. ``NAMELINK_ONLY``
  170. This option causes the installation of only the namelink when a library
  171. target is installed. On platforms where versioned shared libraries do not
  172. have namelinks or when a library is not versioned, the ``NAMELINK_ONLY``
  173. option installs nothing. It is an error to use this parameter outside of a
  174. ``LIBRARY`` block.
  175. When ``NAMELINK_ONLY`` is given, either ``NAMELINK_COMPONENT`` or
  176. ``COMPONENT`` may be used to specify the installation component of the
  177. namelink, but ``COMPONENT`` should generally be preferred.
  178. ``NAMELINK_SKIP``
  179. Similar to ``NAMELINK_ONLY``, but it has the opposite effect: it causes the
  180. installation of library files other than the namelink when a library target
  181. is installed. When neither ``NAMELINK_ONLY`` or ``NAMELINK_SKIP`` are given,
  182. both portions are installed. On platforms where versioned shared libraries
  183. do not have symlinks or when a library is not versioned, ``NAMELINK_SKIP``
  184. installs the library. It is an error to use this parameter outside of a
  185. ``LIBRARY`` block.
  186. If ``NAMELINK_SKIP`` is specified, ``NAMELINK_COMPONENT`` has no effect. It
  187. is not recommended to use ``NAMELINK_SKIP`` in conjunction with
  188. ``NAMELINK_COMPONENT``.
  189. The ``install(TARGETS)`` command can also accept the following options at the
  190. top level:
  191. ``EXPORT``
  192. This option associates the installed target files with an export called
  193. ``<export-name>``. It must appear before any target options. To actually
  194. install the export file itself, call ``install(EXPORT)``, documented below.
  195. ``INCLUDES DESTINATION``
  196. This option specifies a list of directories which will be added to the
  197. :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target property of the
  198. ``<targets>`` when exported by the :command:`install(EXPORT)` command. If a
  199. relative path is specified, it is treated as relative to the
  200. ``$<INSTALL_PREFIX>``.
  201. One or more groups of properties may be specified in a single call to
  202. the ``TARGETS`` form of this command. A target may be installed more than
  203. once to different locations. Consider hypothetical targets ``myExe``,
  204. ``mySharedLib``, and ``myStaticLib``. The code:
  205. .. code-block:: cmake
  206. install(TARGETS myExe mySharedLib myStaticLib
  207. RUNTIME DESTINATION bin
  208. LIBRARY DESTINATION lib
  209. ARCHIVE DESTINATION lib/static)
  210. install(TARGETS mySharedLib DESTINATION /some/full/path)
  211. will install ``myExe`` to ``<prefix>/bin`` and ``myStaticLib`` to
  212. ``<prefix>/lib/static``. On non-DLL platforms ``mySharedLib`` will be
  213. installed to ``<prefix>/lib`` and ``/some/full/path``. On DLL platforms
  214. the ``mySharedLib`` DLL will be installed to ``<prefix>/bin`` and
  215. ``/some/full/path`` and its import library will be installed to
  216. ``<prefix>/lib/static`` and ``/some/full/path``.
  217. :ref:`Interface Libraries` may be listed among the targets to install.
  218. They install no artifacts but will be included in an associated ``EXPORT``.
  219. If :ref:`Object Libraries` are listed but given no destination for their
  220. object files, they will be exported as :ref:`Interface Libraries`.
  221. This is sufficient to satisfy transitive usage requirements of other
  222. targets that link to the object libraries in their implementation.
  223. Installing a target with the :prop_tgt:`EXCLUDE_FROM_ALL` target property
  224. set to ``TRUE`` has undefined behavior.
  225. The install destination given to the target install ``DESTINATION`` may
  226. use "generator expressions" with the syntax ``$<...>``. See the
  227. :manual:`cmake-generator-expressions(7)` manual for available expressions.
  228. .. _install-files:
  229. Installing Files
  230. ^^^^^^^^^^^^^^^^
  231. ::
  232. install(<FILES|PROGRAMS> files... DESTINATION <dir>
  233. [PERMISSIONS permissions...]
  234. [CONFIGURATIONS [Debug|Release|...]]
  235. [COMPONENT <component>]
  236. [RENAME <name>] [OPTIONAL] [EXCLUDE_FROM_ALL])
  237. The ``FILES`` form specifies rules for installing files for a project.
  238. File names given as relative paths are interpreted with respect to the
  239. current source directory. Files installed by this form are by default
  240. given permissions ``OWNER_WRITE``, ``OWNER_READ``, ``GROUP_READ``, and
  241. ``WORLD_READ`` if no ``PERMISSIONS`` argument is given.
  242. The ``PROGRAMS`` form is identical to the ``FILES`` form except that the
  243. default permissions for the installed file also include ``OWNER_EXECUTE``,
  244. ``GROUP_EXECUTE``, and ``WORLD_EXECUTE``. This form is intended to install
  245. programs that are not targets, such as shell scripts. Use the ``TARGETS``
  246. form to install targets built within the project.
  247. The list of ``files...`` given to ``FILES`` or ``PROGRAMS`` may use
  248. "generator expressions" with the syntax ``$<...>``. See the
  249. :manual:`cmake-generator-expressions(7)` manual for available expressions.
  250. However, if any item begins in a generator expression it must evaluate
  251. to a full path.
  252. The install destination given to the files install ``DESTINATION`` may
  253. use "generator expressions" with the syntax ``$<...>``. See the
  254. :manual:`cmake-generator-expressions(7)` manual for available expressions.
  255. .. _install-directory:
  256. Installing Directories
  257. ^^^^^^^^^^^^^^^^^^^^^^
  258. ::
  259. install(DIRECTORY dirs... DESTINATION <dir>
  260. [FILE_PERMISSIONS permissions...]
  261. [DIRECTORY_PERMISSIONS permissions...]
  262. [USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER]
  263. [CONFIGURATIONS [Debug|Release|...]]
  264. [COMPONENT <component>] [EXCLUDE_FROM_ALL]
  265. [FILES_MATCHING]
  266. [[PATTERN <pattern> | REGEX <regex>]
  267. [EXCLUDE] [PERMISSIONS permissions...]] [...])
  268. The ``DIRECTORY`` form installs contents of one or more directories to a
  269. given destination. The directory structure is copied verbatim to the
  270. destination. The last component of each directory name is appended to
  271. the destination directory but a trailing slash may be used to avoid
  272. this because it leaves the last component empty. Directory names
  273. given as relative paths are interpreted with respect to the current
  274. source directory. If no input directory names are given the
  275. destination directory will be created but nothing will be installed
  276. into it. The ``FILE_PERMISSIONS`` and ``DIRECTORY_PERMISSIONS`` options
  277. specify permissions given to files and directories in the destination.
  278. If ``USE_SOURCE_PERMISSIONS`` is specified and ``FILE_PERMISSIONS`` is not,
  279. file permissions will be copied from the source directory structure.
  280. If no permissions are specified files will be given the default
  281. permissions specified in the ``FILES`` form of the command, and the
  282. directories will be given the default permissions specified in the
  283. ``PROGRAMS`` form of the command.
  284. The ``MESSAGE_NEVER`` option disables file installation status output.
  285. Installation of directories may be controlled with fine granularity
  286. using the ``PATTERN`` or ``REGEX`` options. These "match" options specify a
  287. globbing pattern or regular expression to match directories or files
  288. encountered within input directories. They may be used to apply
  289. certain options (see below) to a subset of the files and directories
  290. encountered. The full path to each input file or directory (with
  291. forward slashes) is matched against the expression. A ``PATTERN`` will
  292. match only complete file names: the portion of the full path matching
  293. the pattern must occur at the end of the file name and be preceded by
  294. a slash. A ``REGEX`` will match any portion of the full path but it may
  295. use ``/`` and ``$`` to simulate the ``PATTERN`` behavior. By default all
  296. files and directories are installed whether or not they are matched.
  297. The ``FILES_MATCHING`` option may be given before the first match option
  298. to disable installation of files (but not directories) not matched by
  299. any expression. For example, the code
  300. .. code-block:: cmake
  301. install(DIRECTORY src/ DESTINATION include/myproj
  302. FILES_MATCHING PATTERN "*.h")
  303. will extract and install header files from a source tree.
  304. Some options may follow a ``PATTERN`` or ``REGEX`` expression and are applied
  305. only to files or directories matching them. The ``EXCLUDE`` option will
  306. skip the matched file or directory. The ``PERMISSIONS`` option overrides
  307. the permissions setting for the matched file or directory. For
  308. example the code
  309. .. code-block:: cmake
  310. install(DIRECTORY icons scripts/ DESTINATION share/myproj
  311. PATTERN "CVS" EXCLUDE
  312. PATTERN "scripts/*"
  313. PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
  314. GROUP_EXECUTE GROUP_READ)
  315. will install the ``icons`` directory to ``share/myproj/icons`` and the
  316. ``scripts`` directory to ``share/myproj``. The icons will get default
  317. file permissions, the scripts will be given specific permissions, and any
  318. ``CVS`` directories will be excluded.
  319. The list of ``dirs...`` given to ``DIRECTORY`` and the install destination
  320. given to the directory install ``DESTINATION`` may use "generator expressions"
  321. with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
  322. manual for available expressions.
  323. .. _install-script:
  324. Custom Installation Logic
  325. ^^^^^^^^^^^^^^^^^^^^^^^^^
  326. ::
  327. install([[SCRIPT <file>] [CODE <code>]]
  328. [COMPONENT <component>] [EXCLUDE_FROM_ALL] [...])
  329. The ``SCRIPT`` form will invoke the given CMake script files during
  330. installation. If the script file name is a relative path it will be
  331. interpreted with respect to the current source directory. The ``CODE``
  332. form will invoke the given CMake code during installation. Code is
  333. specified as a single argument inside a double-quoted string. For
  334. example, the code
  335. .. code-block:: cmake
  336. install(CODE "MESSAGE(\"Sample install message.\")")
  337. will print a message during installation.
  338. .. _install-export:
  339. Installing Exports
  340. ^^^^^^^^^^^^^^^^^^
  341. ::
  342. install(EXPORT <export-name> DESTINATION <dir>
  343. [NAMESPACE <namespace>] [[FILE <name>.cmake]|
  344. [PERMISSIONS permissions...]
  345. [CONFIGURATIONS [Debug|Release|...]]
  346. [EXPORT_LINK_INTERFACE_LIBRARIES]
  347. [COMPONENT <component>]
  348. [EXCLUDE_FROM_ALL])
  349. install(EXPORT_ANDROID_MK <export-name> DESTINATION <dir> [...])
  350. The ``EXPORT`` form generates and installs a CMake file containing code to
  351. import targets from the installation tree into another project.
  352. Target installations are associated with the export ``<export-name>``
  353. using the ``EXPORT`` option of the ``install(TARGETS)`` signature
  354. documented above. The ``NAMESPACE`` option will prepend ``<namespace>`` to
  355. the target names as they are written to the import file. By default
  356. the generated file will be called ``<export-name>.cmake`` but the ``FILE``
  357. option may be used to specify a different name. The value given to
  358. the ``FILE`` option must be a file name with the ``.cmake`` extension.
  359. If a ``CONFIGURATIONS`` option is given then the file will only be installed
  360. when one of the named configurations is installed. Additionally, the
  361. generated import file will reference only the matching target
  362. configurations. The ``EXPORT_LINK_INTERFACE_LIBRARIES`` keyword, if
  363. present, causes the contents of the properties matching
  364. ``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?`` to be exported, when
  365. policy :policy:`CMP0022` is ``NEW``.
  366. When a ``COMPONENT`` option is given, the listed ``<component>`` implicitly
  367. depends on all components mentioned in the export set. The exported
  368. ``<name>.cmake`` file will require each of the exported components to be
  369. present in order for dependent projects to build properly. For example, a
  370. project may define components ``Runtime`` and ``Development``, with shared
  371. libraries going into the ``Runtime`` component and static libraries and
  372. headers going into the ``Development`` component. The export set would also
  373. typically be part of the ``Development`` component, but it would export
  374. targets from both the ``Runtime`` and ``Development`` components. Therefore,
  375. the ``Runtime`` component would need to be installed if the ``Development``
  376. component was installed, but not vice versa. If the ``Development`` component
  377. was installed without the ``Runtime`` component, dependent projects that try
  378. to link against it would have build errors. Package managers, such as APT and
  379. RPM, typically handle this by listing the ``Runtime`` component as a dependency
  380. of the ``Development`` component in the package metadata, ensuring that the
  381. library is always installed if the headers and CMake export file are present.
  382. In addition to cmake language files, the ``EXPORT_ANDROID_MK`` mode maybe
  383. used to specify an export to the android ndk build system. This mode
  384. accepts the same options as the normal export mode. The Android
  385. NDK supports the use of prebuilt libraries, both static and shared. This
  386. allows cmake to build the libraries of a project and make them available
  387. to an ndk build system complete with transitive dependencies, include flags
  388. and defines required to use the libraries.
  389. The ``EXPORT`` form is useful to help outside projects use targets built
  390. and installed by the current project. For example, the code
  391. .. code-block:: cmake
  392. install(TARGETS myexe EXPORT myproj DESTINATION bin)
  393. install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj)
  394. install(EXPORT_ANDROID_MK myexp DESTINATION share/ndk-modules)
  395. will install the executable myexe to ``<prefix>/bin`` and code to import
  396. it in the file ``<prefix>/lib/myproj/myproj.cmake`` and
  397. ``<prefix>/share/ndk-modules/Android.mk``. An outside project
  398. may load this file with the include command and reference the ``myexe``
  399. executable from the installation tree using the imported target name
  400. ``mp_myexe`` as if the target were built in its own tree.
  401. .. note::
  402. This command supercedes the :command:`install_targets` command and
  403. the :prop_tgt:`PRE_INSTALL_SCRIPT` and :prop_tgt:`POST_INSTALL_SCRIPT`
  404. target properties. It also replaces the ``FILES`` forms of the
  405. :command:`install_files` and :command:`install_programs` commands.
  406. The processing order of these install rules relative to
  407. those generated by :command:`install_targets`,
  408. :command:`install_files`, and :command:`install_programs` commands
  409. is not defined.
  410. Generated Installation Script
  411. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  412. The ``install()`` command generates a file, ``cmake_install.cmake``, inside
  413. the build directory, which is used internally by the generated install target
  414. and by CPack. You can also invoke this script manually with ``cmake -P``. This
  415. script accepts several variables:
  416. ``COMPONENT``
  417. Set this variable to install only a single CPack component as opposed to all
  418. of them. For example, if you only want to install the ``Development``
  419. component, run ``cmake -DCOMPONENT=Development -P cmake_install.cmake``.
  420. ``BUILD_TYPE``
  421. Set this variable to change the build type if you are using a multi-config
  422. generator. For example, to install with the ``Debug`` configuration, run
  423. ``cmake -DBUILD_TYPE=Debug -P cmake_install.cmake``.
  424. ``DESTDIR``
  425. This is an environment variable rather than a CMake variable. It allows you
  426. to change the installation prefix on UNIX systems. See :envvar:`DESTDIR` for
  427. details.