diff options
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 0087ca0..2a27d3f 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -18,6 +18,7 @@ #include "stdio.h" #include <sys/stat.h> #include "cmRegularExpression.h" +#include <ctype.h> #if defined(_MSC_VER) || defined(__BORLANDC__) #include <windows.h> @@ -502,3 +503,19 @@ void cmSystemTools::RemoveFile(const char* source) { unlink(source); } + +bool cmSystemTools::IsOn(const char* val) +{ + if (!val) + { + return false; + } + std::basic_string<char> v = val; + + for(std::basic_string<char>::iterator c = v.begin(); + c != v.end(); c++) + { + *c = toupper(*c); + } + return (v == "ON" || v == "1" || v == "YES" || v == "TRUE" || v == "Y"); +} |