View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0001067 | CMake | public | 2004-08-17 23:56 | 2004-08-23 11:40 | |||||
Reporter | mtrudeau | ||||||||
Assigned To | Brad King | ||||||||
Priority | high | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0001067: erratic behavior of 'MATCHES' | ||||||||
Description | I'm getting a bug from running CMake on wxArt2D. To illustrate the problem better, I added the following lines to FindExpat.cmake: IF("EXPAT_HDR_OK3" MATCHES "^EXPAT_HDR_OK3$") MESSAGE("match underscore") ELSE("EXPAT_HDR_OK3" MATCHES "^EXPAT_HDR_OK3$") MESSAGE("no match underscore") ENDIF("EXPAT_HDR_OK3" MATCHES "^EXPAT_HDR_OK3$") IF("EXPATHDROK3" MATCHES "^EXPATHDROK3$") MESSAGE("match block") ELSE("EXPATHDROK3" MATCHES "^EXPATHDROK3$") MESSAGE("no match block") ENDIF("EXPATHDROK3" MATCHES "^EXPATHDROK3$") IF("EXPAT-HDR-OK3" MATCHES "^EXPAT-HDR-OK3$") MESSAGE("match dash") ELSE("EXPAT-HDR-OK3" MATCHES "^EXPAT-HDR-OK3$") MESSAGE("no match dash") ENDIF("EXPAT-HDR-OK3" MATCHES "^EXPAT-HDR-OK3$") These code lines produce different output in different situations, especially when I change the name of the variable EXPAT_HDR_OK3 to one of the above. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0001395) Bill Hoffman (manager) 2004-08-23 11:27 |
I think this was resolved on the cmake list right? If so, Brad, can you close this bug? -Bill |
(0001396) Brad King (manager) 2004-08-23 11:40 |
This is not a bug. The behavior of the IF command for MATCHES is documented at http://www.cmake.org/HTML/Documentation.html [^] and by "cmake --help-command IF". The command IF(FOO MATCHES BAR) tests whether the contents of the variable FOO matches the regular expression "BAR". If the variable is not defined then its name is matched against the regular expression. Therefore IF(FOO MATCHES "^FOO$") is a way to test whether the variable FOO is defined (unless it is defined to its own name). This kind of test appears in many places that were written before the DEFINED option was added to the IF command. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |