[CMake] Double @-substitution and configure_file()??

David Cole david.cole at kitware.com
Mon Jan 18 11:55:32 EST 2010


On Mon, Jan 18, 2010 at 10:28 AM, Marcel Loose <loose at astron.nl> wrote:

> Hi all,
>
> Is it possible to somehow do a double @-substitution when using, e.g.,
> configure_file, similar to a double ${${...}} construct.
>
> $ cat myvar.cmake
> message(STATUS "@MYVAR@=@@MYVAR@@")
> message(STATUS "${MYVAR}=${${MYVAR}}")
>
> $ cmake -D MYVAR=Hello -D Hello="Hello World" -P myvar.cmake
> -- Hello=@Hello@
> -- Hello=Hello World
>
> Apparently this doesn't produce the same results.
>
> Best regards,
> Marcel Loose.
>


No double-@ substitution, and I'm not sure it would be desirable....

But you could do something like this *before* configure_file:

set(myvar2name "${MYVAR}")
set(myvar2val "${${MYVAR}}")
message(STATUS "@myvar2name@=@myvar2val@")
message(STATUS "${myvar2name}=${myvar2val}")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100118/24cf561e/attachment.htm>


More information about the CMake mailing list