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

Kris Dekeyser Kris.Dekeyser at lms.be
Fri Jun 30 09:32:00 EDT 2006


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

So, is this:
a) a bug ?
b) a fixed bug ?

If b), how should I modify my RegEx expression to get the desired result?

I have to work with the Cmake book for version 1.8 for now.
+-+-+- 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