[CMake] Regex changes between cmake 2.0.6 and 2.4.2 ??

Brad King brad.king at kitware.com
Mon Jul 3 13:12:56 EDT 2006


Kris Dekeyser wrote:
> I'm pretty sure something changed in the the interpretation of variables. I attached a simple CMakeLists.txt file that shows the difference along with a configuration file to read in.

Yes, this did change, but the original behavior was not intended or 
documented.  Note the documentation of the FILE(READ) option from 2.0:

   READ will read the content of a file and store it into the variable.

This says nothing about replacing variables.  The change was a bug fix.

> In Cmake 2.0.6 it runs fine. In Cmake 2.4.2 it fails when reading the configuration file. The backslashes in the last line need to be escaped. Also, in the first line the ${...} string is not replace with the variable's contents. That's what causes the test to fail.
> 
> Note that the CMakeLists.txt program copies each word in ${line} into a WordList variable. It's pretty useless in the test program, but in our configuration it actually filters out some important keywords. If I skip that step in the test program, the test fails with Cmake 2.0.6, so I asume that the variable interpretation was done in that step in the older Cmake.
> 
> Is there a way in Cmake 2.0.4 to force the interpretation of variables in strings?

STRING(CONFIGURE ...)

-Brad


More information about the CMake mailing list