[CMake] nested replacement with @@
Eric Noulard
eric.noulard at gmail.com
Wed Apr 10 14:49:50 EDT 2013
2013/4/10 Nico Schlömer <nico.schloemer at gmail.com>
> Hi all,
>
> in a ProjectContfigTemplate.cmake.in file, I'd like to have variables
> such as ${${PROJECT_NAME}_VERSION}. In ${}-syntax, the nesting is
> recognized properly, and this string would be replaced by, e.g.,
> "2.1".
>
> I know need to have ${}-variables in the output file, so I tried to
> switch to the @-syntax.
then I guess you use configure_file(... @ONLY)
> Replacing the above line by
>
> @@PROJECT_NAME at _VERSION@
>
> doesn't work however: The output file contains
>
> @Myproject_VERSION@
>
> i.e., only the inner variable was replaced.
>
> How to fix this?
>
May be it's a feature not a bug.
(honestly I don't know but I guess the behavior has probably been here
for ages so that people may rely on it)
Did you try protecting the $ that needs to be with \$
Or
set(PDOLLAR "$") and use ${PDOLLAR}
--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130410/d6f5a159/attachment.htm>
More information about the CMake
mailing list