Am Thursday, 10. November 2011, 18:48:06 schrieb vagn scott:
> is there something like
>          cmake --dump-var PROJECT_NAME
> that would output the string
>          hello_foo_baz

As far as I know CMake doesn't do this out of the box. As long as you have a 
configured build tree and only want to access cache variables, you could use 
the script mode.

Create a script named "printvar.cmake" with the following command:

message(${${VAR}})

Then you can do this in the build directory:

cmake . -DVAR=CMAKE_PROJECT_NAME -P ../printvar.cmake

Be aware, though, that the message is printed to stderr, not stdout. Other 
than that (and the issue that it is a dirty hack), this should do what you 
need...

Cheers,
  Johannes
--

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