summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-08-18 12:25:31 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-01 13:25:19 (GMT)
commitf14b390198222f5d7eca9e5109fabcb0188da762 (patch)
treead67bb4af6f85bf6fb2f4b157881a2f1e1a4a9da /Help/command
parent5294febcaf378589dba49801321d19f93f67464e (diff)
downloadCMake-f14b390198222f5d7eca9e5109fabcb0188da762.zip
CMake-f14b390198222f5d7eca9e5109fabcb0188da762.tar.gz
CMake-f14b390198222f5d7eca9e5109fabcb0188da762.tar.bz2
GenEx: Remove unneeded dependencies from target info queries
Only generate a graph dependency between a custom command and a target when the custom command queries for the file path of an artifact of the target. This makes generator expressions such as `TARGET_FILE_DIR` behave the same way as `TARGET_PROPERTY` which never generated a graph dependency.
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/add_custom_command.rst23
-rw-r--r--Help/command/add_custom_target.rst13
2 files changed, 25 insertions, 11 deletions
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 9279748..231f9da 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -102,13 +102,22 @@ The options are:
a target later in the command line (i.e. as a command argument rather
than as the command to execute).
- Whenever a target is used as a command to execute or is mentioned in a
- generator expression as a command argument, a target-level dependency
- will be added automatically so that the mentioned target will be built
- before any target using this custom command. However this does NOT add
- a file-level dependency that would cause the custom command to re-run
- whenever the executable is recompiled. List target names with
- the ``DEPENDS`` option to add such file-level dependencies.
+ Whenever one of the following target based generator expressions are used as
+ a command to execute or is mentioned in a command argument, a target-level
+ dependency will be added automatically so that the mentioned target will be
+ built before any target using this custom command
+ (see policy :policy:`CMP0112`).
+
+ * ``TARGET_FILE``
+ * ``TARGET_LINKER_FILE``
+ * ``TARGET_SONAME_FILE``
+ * ``TARGET_PDB_FILE``
+
+ This target-level dependency does NOT add a file-level dependency that would
+ cause the custom command to re-run whenever the executable is recompiled.
+ List target names with the ``DEPENDS`` option to add such file-level
+ dependencies.
+
``COMMENT``
Display the given message before the commands are executed at
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index 56ab414..2eb0c88 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -81,10 +81,15 @@ The options are:
a target later in the command line (i.e. as a command argument rather
than as the command to execute).
- Whenever a target is used as a command to execute or is mentioned in a
- generator expression as a command argument, a target-level dependency
- will be added automatically so that the mentioned target will be built
- before this custom target.
+ Whenever one of the following target based generator expressions are used as
+ a command to execute or is mentioned in a command argument, a target-level
+ dependency will be added automatically so that the mentioned target will be
+ built before this custom target (see policy :policy:`CMP0112`).
+
+ * ``TARGET_FILE``
+ * ``TARGET_LINKER_FILE``
+ * ``TARGET_SONAME_FILE``
+ * ``TARGET_PDB_FILE``
The command and arguments are optional and if not specified an empty
target will be created.