diff options
author | Brad King <brad.king@kitware.com> | 2023-08-02 18:53:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-08-03 16:49:53 (GMT) |
commit | 0827305032234e651144e8b7051568a21bb090ef (patch) | |
tree | 45f4bf7010fc8c4a871b1bef6aa9a9b2a6ff223f /Help | |
parent | 7bd6478dd06b73b32a8a0d72883eceb912f91176 (diff) | |
download | CMake-0827305032234e651144e8b7051568a21bb090ef.zip CMake-0827305032234e651144e8b7051568a21bb090ef.tar.gz CMake-0827305032234e651144e8b7051568a21bb090ef.tar.bz2 |
Help: Clarify install(TARGETS) artifact-kind option group ordering
Revise the signature and description to explicitly distinguish the
initial group of artifact options from later groups that apply to
a specific kind.
Issue: #25144
Fixes: #16362
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/install.rst | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/Help/command/install.rst b/Help/command/install.rst index 12aa906..899afea 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -38,6 +38,8 @@ are executed in order during installation. The environment variable :envvar:`CMAKE_INSTALL_MODE` can override the default copying behavior of ``install()``. +.. _`common options`: + There are multiple signatures for this command. Some of them define installation options for files and targets. Options common to multiple signatures are covered here but they are valid only for @@ -69,10 +71,20 @@ signatures that specify them. The common options are: ``WORLD_EXECUTE``, ``SETUID``, and ``SETGID``. Permissions that do not make sense on certain platforms are ignored on those platforms. + If this option is used multiple times in a single call, its list + of permissions accumulates. If an :command:`install(TARGETS)` call + uses `\<artifact-kind\>`_ arguments, a separate list of permissions + is accumulated for each kind of artifact. + ``CONFIGURATIONS <config>...`` Specify a list of build configurations for which the install rule applies (Debug, Release, etc.). + If this option is used multiple times in a single call, its list + of configurations accumulates. If an :command:`install(TARGETS)` + call uses `\<artifact-kind\>`_ arguments, a separate list of + configurations is accumulated for each kind of artifact. + ``COMPONENT <component>`` Specify an installation component name with which the install rule is associated, such as ``Runtime`` or ``Development``. During @@ -123,23 +135,31 @@ Signatures install(TARGETS <target>... [EXPORT <export-name>] [RUNTIME_DEPENDENCIES <arg>...|RUNTIME_DEPENDENCY_SET <set-name>] - [[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE| - PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE| - FILE_SET <set-name>|CXX_MODULES_BMI] - [DESTINATION <dir>] - [PERMISSIONS <permission>...] - [CONFIGURATIONS <config>...] - [COMPONENT <component>] - [NAMELINK_COMPONENT <component>] - [OPTIONAL] [EXCLUDE_FROM_ALL] - [NAMELINK_ONLY|NAMELINK_SKIP] - ] [...] + [<artifact-option>...] + [<artifact-kind> <artifact-option>...]... [INCLUDES DESTINATION [<dir> ...]] ) - The ``TARGETS`` form specifies rules for installing targets from a - project. There are several kinds of target :ref:`Output Artifacts` - that may be installed: + where ``<artifact-option>...`` group may contain: + + .. code-block:: cmake + + [DESTINATION <dir>] + [PERMISSIONS <permission>...] + [CONFIGURATIONS <config>...] + [COMPONENT <component>] + [NAMELINK_COMPONENT <component>] + [OPTIONAL] [EXCLUDE_FROM_ALL] + [NAMELINK_ONLY|NAMELINK_SKIP] + + The first ``<artifact-option>...`` group applies to target + :ref:`Output Artifacts` that do not have a dedicated group specified + later in the same call. + + .. _`<artifact-kind>`: + + Each ``<artifact-kind> <artifact-option>...`` group applies to + :ref:`Output Artifacts` of the specified artifact kind: ``ARCHIVE`` Target artifacts of this kind include: @@ -223,10 +243,6 @@ Signatures derived from the names of the modules. An empty ``DESTINATION`` may be used to suppress installing these files (for use in generic code). - For each of these arguments given, the arguments following them only apply - to the target or file type specified in the argument. If none is given, the - installation properties apply to all target types. - For regular executables, static libraries and shared libraries, the ``DESTINATION`` argument is not required. For these target types, when ``DESTINATION`` is omitted, a default destination will be taken from the @@ -285,7 +301,7 @@ Signatures DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/myproj ) - In addition to the common options listed above, each target can accept + In addition to the `common options`_ listed above, each target can accept the following additional arguments: ``NAMELINK_COMPONENT`` |