[CMake] Re: Will ${string_${var}_string} work?

Francesco Montorsi f18m_cpp217828 at yahoo.it
Fri Sep 15 14:19:31 EDT 2006


Thanks, I've tested and it works.


Francesco Montorsi ha scritto:
> Hi all,
>     sorry I'm a cmake newbie and I need to know one thing.
> 
> Is it safe to do e.g.
> 
>    SET( ABC_VAR_DEF   "test2" )
> 
>    ...
> 
>    SET( MYVARIABLE   "VAR" )
>    IF( ${ABC_${MYVARIABLE}_DEF} STREQUAL "test2" )
> 
>     # will ABC_VAR_DEF be correctly compared with "test2" string?
>     ....
> 
> ?
> 
> I'd like to do the ${string_${var}_string} trick in a FOREACH loop...
> I'm used to this kind of tricks in the BASH shell using eval() function 
> but I'm not sure if it will work with Cmake under all platforms..
> 
> Thanks a lot !
> Francesco



More information about the CMake mailing list