TARGET_PROPERTY

$<TARGET_PROPERTY:prop>

This generator expression belongs to the Target-Dependent Expressions family. See that section for related generator expressions.

Syntax

$<TARGET_PROPERTY:tgt,prop>

Value of the property prop on the target tgt, or empty if the property is not set.

Note that tgt is not added as a dependency of the target this expression is evaluated on.

Changed in version 3.26: When encountered during evaluation of 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 expression is being evaluated.

Syntax

$<TARGET_PROPERTY:prop>

Value of the property prop on the target for which the expression is being evaluated, or empty if the property is not set. Note that for generator expressions in Target Usage Requirements this is the consuming target rather than the target specifying the requirement. For generator expressions in source file properties, this is the target compiling the source file, so a source file shared by several targets can be compiled differently by each.