summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-buildsystem.7.rst14
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst17
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/prop_tgt/TRANSITIVE_COMPILE_PROPERTIES.rst4
-rw-r--r--Help/prop_tgt/TRANSITIVE_LINK_PROPERTIES.rst19
-rw-r--r--Help/release/dev/custom-transitive-properties.rst4
6 files changed, 53 insertions, 6 deletions
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 4dc2306..eb25a4a 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -614,7 +614,8 @@ The :genex:`TARGET_PROPERTY` generator expression evaluates the above
`usage requirement <Target Usage Requirements_>`_ properties
as builtin transitive properties. It also supports custom transitive
properties defined by the :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES`
-property on the target and its link dependencies.
+and :prop_tgt:`TRANSITIVE_LINK_PROPERTIES` properties on the target
+and its link dependencies.
For example:
@@ -623,21 +624,26 @@ For example:
add_library(example INTERFACE)
set_target_properties(example PROPERTIES
TRANSITIVE_COMPILE_PROPERTIES "CUSTOM_C"
+ TRANSITIVE_LINK_PROPERTIES "CUSTOM_L"
INTERFACE_CUSTOM_C "EXAMPLE_CUSTOM_C"
+ INTERFACE_CUSTOM_L "EXAMPLE_CUSTOM_L"
)
add_library(mylib STATIC mylib.c)
target_link_libraries(mylib PRIVATE example)
set_target_properties(mylib PROPERTIES
CUSTOM_C "MYLIB_PRIVATE_CUSTOM_C"
+ CUSTOM_L "MYLIB_PRIVATE_CUSTOM_L"
INTERFACE_CUSTOM_C "MYLIB_IFACE_CUSTOM_C"
+ INTERFACE_CUSTOM_L "MYLIB_IFACE_CUSTOM_L"
)
add_executable(myexe myexe.c)
target_link_libraries(myexe PRIVATE mylib)
set_target_properties(myexe PROPERTIES
CUSTOM_C "MYEXE_CUSTOM_C"
+ CUSTOM_L "MYEXE_CUSTOM_L"
)
add_custom_target(print ALL VERBATIM
@@ -645,8 +651,14 @@ For example:
# Prints "MYLIB_PRIVATE_CUSTOM_C;EXAMPLE_CUSTOM_C"
"$<TARGET_PROPERTY:mylib,CUSTOM_C>"
+ # Prints "MYLIB_PRIVATE_CUSTOM_L;EXAMPLE_CUSTOM_L"
+ "$<TARGET_PROPERTY:mylib,CUSTOM_L>"
+
# Prints "MYEXE_CUSTOM_C"
"$<TARGET_PROPERTY:myexe,CUSTOM_C>"
+
+ # Prints "MYEXE_CUSTOM_L;MYLIB_IFACE_CUSTOM_L;EXAMPLE_CUSTOM_L"
+ "$<TARGET_PROPERTY:myexe,CUSTOM_L>"
)
.. _`Compatible Interface Properties`:
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index d0d751b..bc32452 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -1818,7 +1818,7 @@ The expressions have special evaluation rules for some properties:
* Evaluation of :genex:`$<TARGET_PROPERTY:tgt,PROP>` for some property
``PROP``, named without an ``INTERFACE_`` prefix,
checks the :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES`
- property on target ``tgt``,
+ and :prop_tgt:`TRANSITIVE_LINK_PROPERTIES` properties on target ``tgt``,
on targets named by its :prop_tgt:`LINK_LIBRARIES`, and on the
transitive closure of targets named by the linked targets'
:prop_tgt:`INTERFACE_LINK_LIBRARIES`.
@@ -1834,10 +1834,15 @@ The expressions have special evaluation rules for some properties:
the closure of the linked targets' :prop_tgt:`INTERFACE_LINK_LIBRARIES`,
excluding entries guarded by the :genex:`LINK_ONLY` generator expression.
+ * If ``PROP`` is named by :prop_tgt:`TRANSITIVE_LINK_PROPERTIES`,
+ evaluation of the corresponding ``INTERFACE_PROP`` is transitive over
+ the closure of the linked targets' :prop_tgt:`INTERFACE_LINK_LIBRARIES`,
+ including entries guarded by the :genex:`LINK_ONLY` generator expression.
+
* Evaluation of :genex:`$<TARGET_PROPERTY:tgt,INTERFACE_PROP>` for some
property ``INTERFACE_PROP``, named with an ``INTERFACE_`` prefix,
checks the :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES`
- property on target ``tgt``,
+ and :prop_tgt:`TRANSITIVE_LINK_PROPERTIES` properties on target ``tgt``,
and on the transitive closure of targets named by its
:prop_tgt:`INTERFACE_LINK_LIBRARIES`.
@@ -1853,6 +1858,14 @@ The expressions have special evaluation rules for some properties:
the closure of the target's :prop_tgt:`INTERFACE_LINK_LIBRARIES`,
excluding entries guarded by the :genex:`LINK_ONLY` generator expression.
+ * If ``PROP`` is named by :prop_tgt:`TRANSITIVE_LINK_PROPERTIES`,
+ evaluation of the corresponding ``INTERFACE_PROP`` is transitive over
+ the closure of the target's :prop_tgt:`INTERFACE_LINK_LIBRARIES`,
+ including entries guarded by the :genex:`LINK_ONLY` generator expression.
+
+ If a ``PROP`` is named by both :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES`
+ and :prop_tgt:`TRANSITIVE_LINK_PROPERTIES`, the latter takes precedence.
+
:ref:`Compatible Interface Properties`
These evaluate as a single value combined from the target itself,
from targets named by the target's :prop_tgt:`LINK_LIBRARIES`, and
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 48e1d54..549ec53 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -402,6 +402,7 @@ Properties on Targets
/prop_tgt/SYSTEM
/prop_tgt/TEST_LAUNCHER
/prop_tgt/TRANSITIVE_COMPILE_PROPERTIES
+ /prop_tgt/TRANSITIVE_LINK_PROPERTIES
/prop_tgt/TYPE
/prop_tgt/UNITY_BUILD
/prop_tgt/UNITY_BUILD_BATCH_SIZE
diff --git a/Help/prop_tgt/TRANSITIVE_COMPILE_PROPERTIES.rst b/Help/prop_tgt/TRANSITIVE_COMPILE_PROPERTIES.rst
index a7777c3..b190f3b 100644
--- a/Help/prop_tgt/TRANSITIVE_COMPILE_PROPERTIES.rst
+++ b/Help/prop_tgt/TRANSITIVE_COMPILE_PROPERTIES.rst
@@ -14,4 +14,6 @@ Any leading ``INTERFACE_`` prefix is ignored, e.g., ``INTERFACE_PROP`` is
treated as just ``PROP``.
See documentation of the :genex:`TARGET_PROPERTY` generator expression
-for details of custom transitive property evaluation.
+for details of custom transitive property evaluation. See also the
+:prop_tgt:`TRANSITIVE_LINK_PROPERTIES` target property, which includes
+entries guarded by :genex:`LINK_ONLY`.
diff --git a/Help/prop_tgt/TRANSITIVE_LINK_PROPERTIES.rst b/Help/prop_tgt/TRANSITIVE_LINK_PROPERTIES.rst
new file mode 100644
index 0000000..adb5808
--- /dev/null
+++ b/Help/prop_tgt/TRANSITIVE_LINK_PROPERTIES.rst
@@ -0,0 +1,19 @@
+TRANSITIVE_LINK_PROPERTIES
+--------------------------
+
+.. versionadded:: 3.30
+
+Properties that the :genex:`TARGET_PROPERTY` generator expression, on the
+target and its dependents, evaluates as the union of values collected from
+the transitive closure of link dependencies, including entries guarded by
+:genex:`LINK_ONLY`.
+
+The value is a :ref:`semicolon-separated list <CMake Language Lists>`
+of :ref:`custom transitive property <Custom Transitive Properties>` names.
+Any leading ``INTERFACE_`` prefix is ignored, e.g., ``INTERFACE_PROP`` is
+treated as just ``PROP``.
+
+See documentation of the :genex:`TARGET_PROPERTY` generator expression
+for details of custom transitive property evaluation. See also the
+:prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES` target property, which excludes
+entries guarded by :genex:`LINK_ONLY`..
diff --git a/Help/release/dev/custom-transitive-properties.rst b/Help/release/dev/custom-transitive-properties.rst
index aafa2f2..95c6e14 100644
--- a/Help/release/dev/custom-transitive-properties.rst
+++ b/Help/release/dev/custom-transitive-properties.rst
@@ -3,5 +3,5 @@ custom-transitive-properties
* The :genex:`TARGET_PROPERTY` generator expression learned to evaluate
:ref:`custom transitive properties <Custom Transitive Properties>`
- defined by a new :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES`
- target property.
+ defined by new :prop_tgt:`TRANSITIVE_COMPILE_PROPERTIES` and
+ :prop_tgt:`TRANSITIVE_LINK_PROPERTIES` target properties.