summaryrefslogtreecommitdiffstats
path: root/Help/command/add_custom_target.rst
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-25 15:18:16 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-11-25 15:18:16 (GMT)
commit0f192080761529518128ee697d477ab5ec2e7ea8 (patch)
treec76d41b78e0533aff28830ef506e768ed6aa4acc /Help/command/add_custom_target.rst
parentc5ac0fce5cf1020f661418eb1dc1f35c8f3207ed (diff)
parent557aef0b94c86d13e802e6e8e34a491304d7be2f (diff)
downloadCMake-0f192080761529518128ee697d477ab5ec2e7ea8.zip
CMake-0f192080761529518128ee697d477ab5ec2e7ea8.tar.gz
CMake-0f192080761529518128ee697d477ab5ec2e7ea8.tar.bz2
Merge topic 'custom-command-byproducts'
557aef0b ExternalProject: Add options to specify BYPRODUCTS (#14963) e15a7075 Add an option for explicit BYPRODUCTS of custom commands (#14963)
Diffstat (limited to 'Help/command/add_custom_target.rst')
-rw-r--r--Help/command/add_custom_target.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index 8b7472d..996d08e 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -8,6 +8,7 @@ Add a target with no output so it will always be built.
add_custom_target(Name [ALL] [command1 [args1...]]
[COMMAND command2 [args2...] ...]
[DEPENDS depend depend depend ... ]
+ [BYPRODUCTS [files...]]
[WORKING_DIRECTORY dir]
[COMMENT comment]
[VERBATIM] [USES_TERMINAL]
@@ -28,6 +29,27 @@ The options are:
target so that it will be run every time (the command cannot be
called ``ALL``).
+``BYPRODUCTS``
+ 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
+ relative to the build tree directory corresponding to the
+ current source directory.
+ Each byproduct file will be marked with the :prop_sf:`GENERATED`
+ source file property automatically.
+
+ Explicit specification of byproducts is supported by the
+ :generator:`Ninja` generator to tell the ``ninja`` build tool
+ how to regenerate byproducts when they are missing. It is
+ also useful when other build rules (e.g. custom commands)
+ depend on the byproducts. Ninja requires a build rule for any
+ generated file on which another rule depends even if there are
+ order-only dependencies to ensure the byproducts will be
+ available before their dependents build.
+
+ The ``BYPRODUCTS`` option is ignored on non-Ninja generators
+ except to mark byproducts ``GENERATED``.
+
``COMMAND``
Specify the command-line(s) to execute at build time.
If more than one ``COMMAND`` is specified they will be executed in order,