[CMake] nested replacement with @@

Nico Schlömer nico.schloemer at gmail.com
Wed Apr 10 13:54:42 EDT 2013


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. 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?

Cheers,
Nico


More information about the CMake mailing list