summaryrefslogtreecommitdiff
path: root/Help/command/add_custom_command.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Help/command/add_custom_command.rst')
-rw-r--r--Help/command/add_custom_command.rst21
1 files changed, 20 insertions, 1 deletions
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 293d3f01bc..1ccd4348ec 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -25,7 +25,8 @@ The first signature is for adding a custom command to produce an output:
[DEPFILE depfile]
[JOB_POOL job_pool]
[VERBATIM] [APPEND] [USES_TERMINAL]
- [COMMAND_EXPAND_LISTS])
+ [COMMAND_EXPAND_LISTS]
+ [DEPENDS_EXPLICIT_ONLY])
This defines a command to generate specified ``OUTPUT`` file(s).
A target created in the same directory (``CMakeLists.txt`` file)
@@ -357,6 +358,24 @@ The options are:
:ref:`Makefile Generators`, :ref:`Visual Studio Generators`,
and the :generator:`Xcode` generator.
+``DEPENDS_EXPLICIT_ONLY``
+
+ .. versionadded:: 3.27
+
+ Indicate that the command's ``DEPENDS`` argument represents all files
+ required by the command and implicit dependencies are not required.
+
+ Without this option, if any target uses the output of the custom command,
+ CMake will consider that target's dependencies as implicit dependencies for
+ the custom command in case this custom command requires files implicitly
+ created by those targets.
+
+ This option can be enabled on all custom commands by setting
+ :variable:`CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY` to ``ON``.
+
+ Only the :ref:`Ninja Generators` actually use this information to remove
+ unnecessary implicit dependencies.
+
Examples: Generating Files
^^^^^^^^^^^^^^^^^^^^^^^^^^