[CMake] How to not evaluate variable names ?

Jeroen Dierckx jeroen.dierckx at gmail.com
Wed Sep 30 03:18:26 EDT 2009


On Wed, Sep 30, 2009 at 8:32 AM, <fred.antares at free.fr> wrote:

> Hi,
>
> I've seen a previous discussion on this subject, but unfortunately, none of
> the
> given solutions (as described on
> http://www.cmake.org/Wiki/CMake:VariablesListsStrings) seem to work in my
> case.
>
> I'm using CMake to generate an XML config file, and one of the tags must
> have an
> argument as follows: args="${serverConfigChanged}". The XML is used by
> CruiseControl, and unfortunately, it uses the same variable syntax as
> CMake. I
> tried almost every combination of escaping, double dollars, but couldn't
> get the
> correct output.
>
> Is there some way to achieve that directly from the CMakeList.txt, or
> should I
> do that in the generator code ?
>

Are you using configure_file? Because then you could use the @ONLY option to
ensure only variables of the form @VARNAME@ are replaced.

See http://cmake.org/cmake/help/cmake2.6docs.html#command:configure_file

Greetz,
JeDi



>
> Thanks
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090930/8e1431e4/attachment-0001.htm>


More information about the CMake mailing list