summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmIDEOptions.cxx59
-rw-r--r--Source/cmIDEOptions.h1
2 files changed, 33 insertions, 27 deletions
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index e03223f..eda1ef6 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<int>(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<std::string,std::string>::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;
}
}
@@ -151,6 +125,37 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
}
//----------------------------------------------------------------------------
+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<std::string,std::string>::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)
{
this->Defines.push_back(def);
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index 691893f..82c1a25 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;
};