diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index e03223f76..eda1ef676 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -99,33 +99,7 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, (!(entry->special & cmIDEFlagTable::UserRequired) || static_cast(strlen(flag+1)) > n)) { - if(entry->special & cmIDEFlagTable::UserIgnored) - { - // Ignore the user-specified value. - this->FlagMap[entry->IDEName] = entry->value; - } - else if(entry->special & cmIDEFlagTable::SemicolonAppendable) - { - const char *new_value = flag+1+n; - - std::map::iterator itr; - itr = this->FlagMap.find(entry->IDEName); - if(itr != this->FlagMap.end()) - { - // Append to old value (if present) with semicolons; - itr->second += ";"; - itr->second += new_value; - } - else - { - this->FlagMap[entry->IDEName] = new_value; - } - } - else - { - // Use the user-specified value. - this->FlagMap[entry->IDEName] = flag+1+n; - } + this->FlagMapUpdate(entry, flag+n+1); entry_found = true; } } @@ -150,6 +124,37 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, return false; } +//---------------------------------------------------------------------------- +void cmIDEOptions::FlagMapUpdate(cmIDEFlagTable const* entry, + const char* new_value) +{ + if(entry->special & cmIDEFlagTable::UserIgnored) + { + // Ignore the user-specified value. + this->FlagMap[entry->IDEName] = entry->value; + } + else if(entry->special & cmIDEFlagTable::SemicolonAppendable) + { + std::map::iterator itr; + itr = this->FlagMap.find(entry->IDEName); + if(itr != this->FlagMap.end()) + { + // Append to old value (if present) with semicolons; + itr->second += ";"; + itr->second += new_value; + } + else + { + this->FlagMap[entry->IDEName] = new_value; + } + } + else + { + // Use the user-specified value. + this->FlagMap[entry->IDEName] = new_value; + } +} + //---------------------------------------------------------------------------- void cmIDEOptions::AddDefine(const std::string& def) { diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index 691893f6d..82c1a25ea 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -56,6 +56,7 @@ protected: void HandleFlag(const char* flag); bool CheckFlagTable(cmIDEFlagTable const* table, const char* flag, bool& flag_handled); + void FlagMapUpdate(cmIDEFlagTable const* entry, const char* new_value); virtual void StoreUnknownFlag(const char* flag) = 0; };