[CMake] variables from shell files

Brad King brad.king at kitware.com
Mon Dec 20 12:12:18 EST 2004


chris harris wrote:
>     Is it possible to set a variable in Cmakelists.txt
> by extracting the value of the variable from a shell
> file? My CmakeLists.txt needs to get a value from a
> shell
> program and validate a ctest depending on the
> value.Can anyone please tell me how Cmake communicates
> with a shell file?

You can use FILE(READ ...) and STRING(REGEX ...) to process the shell 
script and extract the value you want.  Visit the online documentation 
or use these commands to get help:

cmake --help-command FILE
cmake --help-command STRING

-Brad


More information about the CMake mailing list