summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx49
-rw-r--r--Source/cmGlobalXCodeGenerator.h1
2 files changed, 34 insertions, 16 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3ac1137..fa9af12 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -710,6 +710,15 @@ cmXCodeObject* cmGlobalXCodeGenerator
}
//----------------------------------------------------------------------------
+cmXCodeObject* cmGlobalXCodeGenerator
+::CreateFlatClone(cmXCodeObject* orig)
+{
+ cmXCodeObject* obj = this->CreateObject(orig->GetType());
+ obj->CopyAttributes(orig);
+ return obj;
+}
+
+//----------------------------------------------------------------------------
std::string
GetGroupMapKeyFromPath(cmGeneratorTarget* target, const std::string& fullpath)
{
@@ -3531,25 +3540,33 @@ bool cmGlobalXCodeGenerator
symroot += "/build";
buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot.c_str()));
- // Put this last so it can override existing settings
- // Convert "CMAKE_XCODE_ATTRIBUTE_*" variables directly.
- {
- std::vector<std::string> vars = this->CurrentMakefile->GetDefinitions();
- for(std::vector<std::string>::const_iterator i = vars.begin();
- i != vars.end(); ++i)
+ for(Configs::iterator i = configs.begin(); i != configs.end(); ++i)
{
- if(i->find("CMAKE_XCODE_ATTRIBUTE_") == 0)
+ cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);
+
+ // Put this last so it can override existing settings
+ // Convert "CMAKE_XCODE_ATTRIBUTE_*" variables directly.
+ std::vector<std::string> vars = this->CurrentMakefile->GetDefinitions();
+ for(std::vector<std::string>::const_iterator d = vars.begin();
+ d != vars.end(); ++d)
{
- buildSettings->AddAttribute(i->substr(22).c_str(),
- this->CreateString(
- this->CurrentMakefile->GetDefinition(i->c_str())));
+ if(d->find("CMAKE_XCODE_ATTRIBUTE_") == 0)
+ {
+ std::string attribute = d->substr(22);
+ this->FilterConfigurationAttribute(i->first, attribute);
+ if(!attribute.empty())
+ {
+ cmGeneratorExpression ge;
+ std::string processed =
+ ge.Parse(this->CurrentMakefile->GetDefinition(*d))
+ ->Evaluate(this->CurrentLocalGenerator, i->first);
+ buildSettingsForCfg->AddAttribute(attribute,
+ this->CreateString(processed));
+ }
+ }
}
- }
- }
-
- for(Configs::iterator i = configs.begin(); i != configs.end(); ++i)
- {
- i->second->AddAttribute("buildSettings", buildSettings);
+ // store per-config buildSettings into configuration object
+ i->second->AddAttribute("buildSettings", buildSettingsForCfg);
}
this->RootObject->AddAttribute("buildConfigurationList",
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 4801064..9659822 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -131,6 +131,7 @@ private:
cmXCodeObject* CreateObject(cmXCodeObject::Type type);
cmXCodeObject* CreateString(const std::string& s);
cmXCodeObject* CreateObjectReference(cmXCodeObject*);
+ cmXCodeObject* CreateFlatClone(cmXCodeObject*);
cmXCodeObject* CreateXCodeTarget(cmGeneratorTarget *gtgt,
cmXCodeObject* buildPhases);
void ForceLinkerLanguages();