[cmake-developers] generator expressions with variable

2014-04-19 Thread Tim Blechmann
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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] generator expressions with variable

2014-04-19 Thread Ben Boeckel
On Sat, Apr 19, 2014 at 12:08:42 +0200, Tim Blechmann wrote:
 $$BOOL:$TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES:-I$JOIN:$TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES,
  -I

Does it work without the variable in there. (By the time the generator
expression evaluator gets the string, it should be expanded.)

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

Should that '$' be ','? Where did your literal ',' go from the above
genex?

--Ben
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] generator expressions with variable

2014-04-19 Thread Tim Blechmann
 $$BOOL:$TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES:-I$JOIN:$TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES,
  -I
 
 Does it work without the variable in there. (By the time the generator
 expression evaluator gets the string, it should be expanded.)
 
 however evaluating the expression results in this command string:
 $1:-I$JOIN:$ -I
 
 Should that '$' be ','? Where did your literal ',' go from the above
 genex?


hmm, i've updated cmake to the current master branch (the other one was
a few days old). now the expression evaluates to (if the properties are
a;b;c):

$1:-I $JOIN:a;b;c , -I

though it does not matter, if the target is passed via variable or directly.

any idea?

thnx,
tim

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers