summaryrefslogtreecommitdiff
path: root/Help/command/add_custom_target.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Help/command/add_custom_target.rst')
-rw-r--r--Help/command/add_custom_target.rst47
1 files changed, 36 insertions, 11 deletions
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index 2eb0c88649..22d3f294d7 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -32,6 +32,8 @@ The options are:
called ``ALL``).
``BYPRODUCTS``
+ .. versionadded:: 3.2
+
Specify the files the command is expected to produce but whose
modification time may or may not be updated on subsequent builds.
If a byproduct name is a relative path it will be interpreted
@@ -52,6 +54,10 @@ The options are:
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
:prop_sf:`GENERATED` files during ``make clean``.
+ .. versionadded:: 3.20
+ Arguments to ``BYPRODUCTS`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
``COMMAND``
Specify the command-line(s) to execute at build time.
If more than one ``COMMAND`` is specified they will be executed in order,
@@ -67,18 +73,19 @@ The options are:
* The target is not being cross-compiled (i.e. the
:variable:`CMAKE_CROSSCOMPILING` variable is not set to true).
- * The target is being cross-compiled and an emulator is provided (i.e.
- its :prop_tgt:`CROSSCOMPILING_EMULATOR` target property is set).
- In this case, the contents of :prop_tgt:`CROSSCOMPILING_EMULATOR` will be
- prepended to the command before the location of the target executable.
+ * .. versionadded:: 3.6
+ The target is being cross-compiled and an emulator is provided (i.e.
+ its :prop_tgt:`CROSSCOMPILING_EMULATOR` target property is set).
+ In this case, the contents of :prop_tgt:`CROSSCOMPILING_EMULATOR` will be
+ prepended to the command before the location of the target executable.
If neither of the above conditions are met, it is assumed that the
command name is a program to be found on the ``PATH`` at build time.
Arguments to ``COMMAND`` may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
- Use the ``TARGET_FILE`` generator expression to refer to the location of
- a target later in the command line (i.e. as a command argument rather
+ Use the :genex:`TARGET_FILE` generator expression to refer to the location
+ of a target later in the command line (i.e. as a command argument rather
than as the command to execute).
Whenever one of the following target based generator expressions are used as
@@ -103,14 +110,18 @@ The options are:
:command:`add_custom_command` command calls in the same directory
(``CMakeLists.txt`` file). They will be brought up to date when
the target is built.
- A target-level dependency is added if any dependency is a byproduct
- of a target or any of its build events in the same directory to ensure
- the byproducts will be available before this target is built.
+
+ .. versionchanged:: 3.16
+ A target-level dependency is added if any dependency is a byproduct
+ of a target or any of its build events in the same directory to ensure
+ the byproducts will be available before this target is built.
Use the :command:`add_dependencies` command to add dependencies
on other targets.
``COMMAND_EXPAND_LISTS``
+ .. versionadded:: 3.8
+
Lists in ``COMMAND`` arguments will be expanded, including those
created with
:manual:`generator expressions <cmake-generator-expressions(7)>`,
@@ -119,6 +130,8 @@ The options are:
to be properly expanded.
``JOB_POOL``
+ .. versionadded:: 3.15
+
Specify a :prop_gbl:`pool <JOB_POOLS>` for the :generator:`Ninja`
generator. Incompatible with ``USES_TERMINAL``, which implies
the ``console`` pool.
@@ -141,6 +154,8 @@ The options are:
tool-specific special characters.
``USES_TERMINAL``
+ .. versionadded:: 3.2
+
The command will be given direct access to the terminal if possible.
With the :generator:`Ninja` generator, this places the command in
the ``console`` :prop_gbl:`pool <JOB_POOLS>`.
@@ -150,5 +165,15 @@ The options are:
If it is a relative path it will be interpreted relative to the
build tree directory corresponding to the current source directory.
- Arguments to ``WORKING_DIRECTORY`` may use
- :manual:`generator expressions <cmake-generator-expressions(7)>`.
+ .. versionadded:: 3.13
+ Arguments to ``WORKING_DIRECTORY`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Ninja Multi-Config
+^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.20
+
+ ``add_custom_target`` supports the :generator:`Ninja Multi-Config`
+ generator's cross-config capabilities. See the generator documentation
+ for more information.