diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-31 18:50:42 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-31 18:50:42 (GMT) |
commit | f58d7df66a4cbfd171ae27eb0beaf12cf5355c08 (patch) | |
tree | ef63fcade1fda3aab970cc0566a66fa085edc1a2 /Source/cmSystemTools.cxx | |
parent | 5e661c66393328896f7a24f50b9f84fe8dd5f029 (diff) | |
download | CMake-f58d7df66a4cbfd171ae27eb0beaf12cf5355c08.zip CMake-f58d7df66a4cbfd171ae27eb0beaf12cf5355c08.tar.gz CMake-f58d7df66a4cbfd171ae27eb0beaf12cf5355c08.tar.bz2 |
ENH: add checking for NOTFOUND
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 4b71bf4..95f4d59 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1188,6 +1188,17 @@ bool cmSystemTools::IsOn(const char* val) return (v == "ON" || v == "1" || v == "YES" || v == "TRUE" || v == "Y"); } +bool cmSystemTools::IsNOTFOUND(const char* val) +{ + cmRegularExpression reg("-NOTFOUND$"); + if(reg.find(val)) + { + return true; + } + return std::string("NOTFOUND") == val; +} + + bool cmSystemTools::IsOff(const char* val) { if (!val || strlen(val) == 0) @@ -1202,7 +1213,7 @@ bool cmSystemTools::IsOff(const char* val) *c = toupper(*c); } return (v == "OFF" || v == "0" || v == "NO" || v == "FALSE" || - v == "N" || v == "NOTFOUND" || v == "IGNORE"); + v == "N" || cmSystemTools::IsNOTFOUND(v.c_str()) || v == "IGNORE"); } |