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

Kris Dekeyser Kris.Dekeyser at lms.be
Mon Jul 3 11:02:32 EDT 2006


Hi Brad,

Yep, I just discovered what it is. The WordList entry actually starts with a ${var}. The text is read from a project configuration file with 
FILE(READ ${Configfile} ConfigFileContents)
When a [Headers] section is encountered, each line is processed. One of these lines contain:
${EDA_ROOT_DIR}/export/include

Now, in Cmake 2.0.6, the variable was interpreted and replaced with the correct path before the IF(... MATCHES ...) test. With Cmake 2.4.2 apparently not.

Does that make any sense?

- Kris

> -----Original Message-----
> From: cmake-bounces+kris.dekeyser=lms.be at cmake.org 
> [mailto:cmake-bounces+kris.dekeyser=lms.be at cmake.org] On 
> Behalf Of Kris Dekeyser
> Sent: maandag 3 juli 2006 16:06
> To: 'Brad King'
> Cc: 'cmake at cmake.org'
> Subject: RE: [CMake] Regex changes between cmake 2.0.6 and 2.4.2 ??
> 
> Brad,
> 
> I grabbed the binaries from the download web page last friday.
> 
> When I run the simple test below, it's fine.
> 
> ---- CMakeLists.txt ----
> 
> SET(WordList "D:\\\\Temp;c:/;/root;relpath;subdir\\\\one")
> 
> MACRO(PRINT_MESSAGE DebugLevel Message)
>   MESSAGE(STATUS "${Message}")
> ENDMACRO(PRINT_MESSAGE)    
> 
> SET(RegexAbsoluteDir "^([a-zA-Z][:])?[/\\\\]")
> 
> #--- Make directories absolute
> SET(DirList)
> 
> MESSAGE(STATUS "${Message}")
> 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} "/MYROOT/${word}")
>   ENDIF(${word} MATCHES ${RegexAbsoluteDir})
>   PRINT_MESSAGE(9 "DirList ${DirList}")
> ENDFOREACH(word)
> 
> ---- Output ----
> 
> --
> -- WordList D:\Temp;c:/;/root;relpath;subdir\one
> -- word D:\Temp
> -- word D:\Temp matches ^([a-zA-Z][:])?[/\]
> -- DirList D:\Temp
> -- word c:/
> -- word c:/ matches ^([a-zA-Z][:])?[/\]
> -- DirList D:\Temp;c:/
> -- word /root
> -- word /root matches ^([a-zA-Z][:])?[/\]
> -- DirList D:\Temp;c:/;/root
> -- word relpath
> -- word relpath does not match ^([a-zA-Z][:])?[/\]
> -- DirList D:\Temp;c:/;/root;/MYROOT/relpath
> -- word subdir\one
> -- word subdir\one does not match ^([a-zA-Z][:])?[/\]
> -- DirList D:\Temp;c:/;/root;/MYROOT/relpath;/MYROOT/subdir\one
> -- Configuring done
> -- Generating done
> -- Build files have been written to: D:/Temp/test
> 
> 
> The weird thing is, that it fails to do the right thing in my 
> own files. The code is almost litteraly the same, though. I 
> really don't get it. That's why it's probably just a small 
> and stupid error ;-)). I just can't find it.
> 
> - Kris
> 
> > -----Original Message-----
> > From: Brad King [mailto:brad.king at kitware.com] 
> > Sent: maandag 3 juli 2006 15:20
> > To: Kris Dekeyser
> > Cc: 'cmake at cmake.org'
> > Subject: Re: [CMake] Regex changes between cmake 2.0.6 and 2.4.2 ??
> > 
> > Kris Dekeyser wrote:
> > >> I just ran your example with 2.4.2 and got the latter output.
> > > Then, is there any configuration setting that could 
> > influence the regex behavior ? 
> > 
> > No.  Did you build CMake 2.4.2 yourself or use a 
> pre-compiled binary?
> > 
> > -Brad
> > 
> +-+-+- Email Confidentiality Footer +-+-+- 
> Privileged/Confidential Information may be contained in this 
> message. If you are not the addressee indicated in this 
> message (or responsible for delivery of the message to such 
> person), you may not print, retain, copy nor disseminate this 
> message or any part of it to anyone and you should notify the 
> sender by reply email and destroy this message. Neglecting 
> this clause could be a breach of confidence. Please advise 
> immediately if you or your employer does not consent to 
> Internet email for messages of this kind. Opinions, 
> conclusions and other information in this message that are 
> not related to the official business of my firm shall be 
> understood as neither given nor endorsed by it.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 
+-+-+- Email Confidentiality Footer +-+-+- 
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not print, retain, copy nor disseminate this message or any part of it to anyone and you should notify the sender by reply email and destroy this message. Neglecting this clause could be a breach of confidence. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that are not related to the official business of my firm shall be understood as neither given nor endorsed by it.


More information about the CMake mailing list