summaryrefslogtreecommitdiffstats
path: root/Source/cmIDEOptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmIDEOptions.cxx')
-rw-r--r--Source/cmIDEOptions.cxx27
1 files changed, 12 insertions, 15 deletions
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index 1f3c066..dfbece7 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -152,18 +152,7 @@ void cmIDEOptions::FlagMapUpdate(cmIDEFlagTable const* entry,
}
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;
- }
+ this->FlagMap[entry->IDEName].push_back(new_value);
}
else
{
@@ -200,6 +189,13 @@ void cmIDEOptions::AddFlag(const char* flag, const char* value)
}
//----------------------------------------------------------------------------
+void cmIDEOptions::AddFlag(const char* flag,
+ std::vector<std::string> const& value)
+{
+ this->FlagMap[flag] = value;
+}
+
+//----------------------------------------------------------------------------
void cmIDEOptions::RemoveFlag(const char* flag)
{
this->FlagMap.erase(flag);
@@ -208,10 +204,11 @@ void cmIDEOptions::RemoveFlag(const char* flag)
//----------------------------------------------------------------------------
const char* cmIDEOptions::GetFlag(const char* flag)
{
- std::map<std::string, std::string>::iterator i = this->FlagMap.find(flag);
- if(i != this->FlagMap.end())
+ // This method works only for single-valued flags!
+ std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(flag);
+ if(i != this->FlagMap.end() && i->second.size() == 1)
{
- return i->second.c_str();
+ return i->second[0].c_str();
}
return 0;
}