2013/4/10 Nico Schlömer <[email protected]>

> 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@_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
--

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

Reply via email to