[cmake-developers] generator expressions with variable

Tim Blechmann tim at klingt.org
Sat Apr 19 06:08:42 EDT 2014


hi all,

i'm trying to obtain the include paths from a target via a generator
expression, which is adapted from the help file:

help:
$<$<BOOL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>>:-I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,
-I>>

i adapted it to obtain the value from a target, which is passed as a
function argument:

$<$<BOOL:$<TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES>>:-I$<JOIN:$<TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES>,
-I>>

however evaluating the expression results in this command string:
$<1:-I$<JOIN:$ -I>>

is this a bug or a feature?

thanks a lot,
tim



More information about the cmake-developers mailing list