When templating ProjectConfig.cmake files, I like to have
${MY_CMAKE_VARIABLE} stuff in the output, so I use @ONLY at configure
time, e.g.,

configure_file(ProjectConfig.cmake.in
               "${PROJECT_BINARY_DIR}/ProjectConfig.cmake" @ONLY)

The @-syntax in ProjectConfig.cmake.in works okay most of the time,
but fails when there are nested variables. Withotu @ONLY, a statement
like

${${PROJECT_NAME}_FLAGS}

would first be expanded to

${MyProject_FLAGS}

and then

<whatever the flags are>.

The syntax

@@PROJECT_NAME@_FLAGS@

merely expands @PROJECT_NAME@, though.
Is there are workaround for this?

Cheers,
Nico
--

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