summaryrefslogtreecommitdiffstats
path: root/Help/policy
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/policy
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/policy')
-rw-r--r--Help/policy/CMP0112.rst39
1 files changed, 39 insertions, 0 deletions
diff --git a/Help/policy/CMP0112.rst b/Help/policy/CMP0112.rst
new file mode 100644
index 0000000..3eab6d2
--- /dev/null
+++ b/Help/policy/CMP0112.rst
@@ -0,0 +1,39 @@
+CMP0112
+-------
+
+.. versionadded:: 3.19
+
+Target file component generator expressions do not add target dependencies.
+
+The following target-based generator expressions that query for directory or
+file name components no longer add a dependency on the evaluated target.
+
+ - ``TARGET_FILE_DIR``
+ - ``TARGET_LINKER_FILE_BASE_NAME``
+ - ``TARGET_LINKER_FILE_NAME``
+ - ``TARGET_LINKER_FILE_DIR``
+ - ``TARGET_SONAME_FILE_NAME``
+ - ``TARGET_SONAME_FILE_DIR``
+ - ``TARGET_PDB_FILE_NAME``
+ - ``TARGET_PDB_FILE_DIR``
+ - ``TARGET_BUNDLE_DIR``
+ - ``TARGET_BUNDLE_CONTENT_DIR``
+
+
+In CMake 3.18 and lower a dependency on the evaluated target of the above
+generator expressions would be always added. CMake 3.19 and above prefer
+to not add this dependency. This policy provides compatibility for projects
+that have not been updated to expect the new behavior.
+
+The ``OLD`` behavior for this policy is to add a dependency on the evaluated
+target for the the above generator expressions. The ``NEW`` behavior of
+this policy is to not add a dependency on the evaluated target for the the
+above generator expressions.
+
+This policy was introduced in CMake version 3.19. Unlike many policies,
+CMake version |release| does *not* warn by default when this policy
+is not set and simply uses ``OLD`` behavior. See documentation of the
+:variable:`CMAKE_POLICY_WARNING_CMP0112 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
+variable to control the warning.
+
+.. include:: DEPRECATED.txt