[CMake] Eval/Exec of a string

Brad King brad.king at kitware.com
Thu Oct 19 10:59:25 EDT 2006


Benjamin THYREAU wrote:
> Does someone know of a way to execute some cmake code contained in a string 
> variable ? Something like INCLUDE, but working from a string instead of a 
> file.

There is no language feature for this.  You could try using
CONFIGURE_FILE to write the string to a file and then INCLUDE the file
but it may complain about reading from a file created by CMake.

What is your motivating use case?  Can it be done with a MACRO?

If you still need it, feature requests may be submitted here:

http://www.cmake.org/Bug

Please include the motivating use case.

-Brad


More information about the CMake mailing list