From 263f6b888c4bb9023a68ddf719c6d6bbb42693e7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 19 Apr 2024 15:13:29 -0400 Subject: [PATCH] Help: Document TARGET_PROPERTY genex handling of transitive properties --- Help/manual/cmake-generator-expressions.7.rst | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 68eb3eeb06..38fa6f98d5 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -1757,8 +1757,7 @@ These expressions look up the values of expression is evaluated on. .. versionchanged:: 3.26 - When encountered during evaluation of - :ref:`usage requirements `, + When encountered during evaluation of :ref:`Target Usage Requirements`, typically in an ``INTERFACE_*`` target property, lookup of the ``tgt`` name occurs in the directory of the target specifying the requirement, rather than the directory of the consuming target for which the @@ -1768,9 +1767,38 @@ These expressions look up the values of :target: TARGET_PROPERTY:prop Value of the property ``prop`` on the target for which the expression - is being evaluated. Note that for generator expressions in - :ref:`usage requirements ` this is the - consuming target rather than the target specifying the requirement. + is being evaluated. Note that for generator expressions in + :ref:`Target Usage Requirements` this is the consuming target rather + than the target specifying the requirement. + +The expressions have special evaluation rules for some properties: + +* :ref:`Target Build Specification` properties evaluate as a + :ref:`semicolon-separated list ` representing the union + of the value on the target itself with the values of the corresponding + :ref:`Target Usage Requirements` on targets named by the target's + :prop_tgt:`LINK_LIBRARIES`. Evaluation of the usage requirements is + transitive over the closure of the linked targets' + :prop_tgt:`INTERFACE_LINK_LIBRARIES`. + + Evaluation of :prop_tgt:`LINK_LIBRARIES` itself is not transitive. + +* :ref:`Target Usage Requirements` evaluate as a + :ref:`semicolon-separated list ` representing the union + of the value on the target itself with the values of the same properties on + targets named by the target's :prop_tgt:`INTERFACE_LINK_LIBRARIES`. + Evaluation is transitive over the closure of the target's + :prop_tgt:`INTERFACE_LINK_LIBRARIES`. + + Evaluation of :prop_tgt:`INTERFACE_LINK_LIBRARIES` itself is not transitive. + +* :ref:`Compatible Interface Properties` evaluate as a single value + combined from the target itself, from targets named by the target's + :prop_tgt:`LINK_LIBRARIES`, and from the transitive closure of the + linked targets' :prop_tgt:`INTERFACE_LINK_LIBRARIES`. Values of a + compatible interface property from multiple targets combine based on + the type of compatibility required by the ``COMPATIBLE_INTERFACE_*`` + property defining it. Target Artifacts