diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-04-26 14:49:12 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-04-26 14:49:12 (GMT) |
commit | 6e5af0e6ccbb0f2c0a4aec00003ea0ce68ea2f95 (patch) | |
tree | f680c0e8c3f843514e620ceeeb09e0391653e4b7 /Source/cmSystemTools.cxx | |
parent | 30ad61805bbb5b34e2bf17cb36ce2e9601ed0f25 (diff) | |
download | CMake-6e5af0e6ccbb0f2c0a4aec00003ea0ce68ea2f95.zip CMake-6e5af0e6ccbb0f2c0a4aec00003ea0ce68ea2f95.tar.gz CMake-6e5af0e6ccbb0f2c0a4aec00003ea0ce68ea2f95.tar.bz2 |
some fixes for If commands
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"); +} |