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

Brad King brad.king at kitware.com
Fri Jun 30 13:24:30 EDT 2006


Kris Dekeyser wrote:
> Hi,
>  
> I was running my build macros in the latest CMake (2.4.2) and encountered very strange errors. With some debug printing I discovered that the new CMake version behaves differently regarding RegEx testing compared to the version 2.0.6 that we currently use.
>  
> This is a summary of what we do:
>  
> SET(RegexAbsoluteDir "^([a-zA-Z][:])?[/\\\\]")
> 
> #--- Make directories absolute
> SET(DirList)
> PRINT_MESSAGE(9 "WordList ${WordList}")
> FOREACH(word ${WordList})
>   PRINT_MESSAGE(9 "word ${word}")
>   IF(${word} MATCHES ${RegexAbsoluteDir})
>     PRINT_MESSAGE(9 "word ${word} matches ${RegexAbsoluteDir}")
>     SET(DirList ${DirList} ${word})
>   ELSE(${word} MATCHES ${RegexAbsoluteDir})
>     PRINT_MESSAGE(9 "word ${word} does not match ${RegexAbsoluteDir}")
>     SET(DirList ${DirList} "${${ProjectName}_SOURCE_DIR}/${word}")
>   ENDIF(${word} MATCHES ${RegexAbsoluteDir})
>   PRINT_MESSAGE(9 "DirList ${DirList}")
> ENDFOREACH(word)
> 
> With Cmake 2.4.2 I got this output:
> 
> -- WordList D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include
> -- word D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include
> -- word D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include does not match ^([a-zA-Z][:])?[/\]
> -- DirList D:/Workspace/EDA/1.1/Packages/EDA_Interface/D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include
> 
> With Cmake 2.0.6 I got:
> 
> -- WordList D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include
> -- word D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include
> -- word D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include matches ^([a-zA-Z][:])?[/\]
> -- DirList D:/Workspace/EDA/1.1/Packages/EDA_Interface/export/include

I just ran your example with 2.4.2 and got the latter output.

-Brad


More information about the CMake mailing list