diff options
author | Brad King <brad.king@kitware.com> | 2016-01-08 14:30:06 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-01-11 09:43:09 -0500 |
commit | 4ca9df8bd1991870a8a4acfeae26933e8ca7dc9a (patch) | |
tree | 52d2f96152f7ee66460a26cf82ca49b0660233c6 /Source/cmIDEOptions.cxx | |
parent | cedbb7994dddce2c3fdf846bf4563c846adf4632 (diff) | |
download | cmake-4ca9df8bd1991870a8a4acfeae26933e8ca7dc9a.tar.gz |
cmIDEOptions: Add support for case-insensitive flags
Diffstat (limited to 'Source/cmIDEOptions.cxx')
-rw-r--r-- | Source/cmIDEOptions.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index 0eb903d843..509602fbdb 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -13,6 +13,8 @@ #include "cmSystemTools.h" +#include <cmsys/String.h> + //---------------------------------------------------------------------------- cmIDEOptions::cmIDEOptions() { @@ -104,7 +106,9 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, // the entry specifies UserRequired we must match only if a // non-empty value is given. int n = static_cast<int>(strlen(entry->commandFlag)); - if(strncmp(flag+1, entry->commandFlag, n) == 0 && + if((strncmp(flag+1, entry->commandFlag, n) == 0 || + (entry->special & cmIDEFlagTable::CaseInsensitive && + cmsysString_strncasecmp(flag+1, entry->commandFlag, n))) && (!(entry->special & cmIDEFlagTable::UserRequired) || static_cast<int>(strlen(flag+1)) > n)) { @@ -112,7 +116,9 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, entry_found = true; } } - else if(strcmp(flag+1, entry->commandFlag) == 0) + else if(strcmp(flag+1, entry->commandFlag) == 0 || + (entry->special & cmIDEFlagTable::CaseInsensitive && + cmsysString_strcasecmp(flag+1, entry->commandFlag) == 0)) { if(entry->special & cmIDEFlagTable::UserFollowing) { |