summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-04-10 15:39:32 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-04-10 15:39:32 (GMT)
commite4f3568099830233e0620c8824bb0a07376cd5a5 (patch)
treeffc51a8f3ef9a9bda52d16407469c1c9d68b4497 /Source/cmGlobalXCodeGenerator.cxx
parent0bad15c302ddb52342beae4f2287a0bfc7c4edc2 (diff)
downloadCMake-e4f3568099830233e0620c8824bb0a07376cd5a5.zip
CMake-e4f3568099830233e0620c8824bb0a07376cd5a5.tar.gz
CMake-e4f3568099830233e0620c8824bb0a07376cd5a5.tar.bz2
ENH: fix so all configurations show up
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx87
1 files changed, 57 insertions, 30 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6724b89..ffef321 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1937,36 +1937,37 @@ void cmGlobalXCodeGenerator::CreateXCodeObjects(cmLocalGenerator* root,
group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("NO"));
cmXCodeObject* developBuildStyle =
this->CreateObject(cmXCodeObject::PBXBuildStyle);
+ cmXCodeObject* listObjs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
if(this->XcodeVersion == 15)
{
developBuildStyle->AddAttribute("name", this->CreateString("Development"));
- }
- else
- {
- developBuildStyle->AddAttribute("name", this->CreateString("Debug"));
- developBuildStyle->SetComment("Debug");
- }
- developBuildStyle->AddAttribute("buildSettings", group);
-
- group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
- group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("YES"));
- cmXCodeObject* deployBuildStyle =
+ developBuildStyle->AddAttribute("buildSettings", group);
+ listObjs->AddObject(developBuildStyle);
+ group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
+ group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("YES"));
+ cmXCodeObject* deployBuildStyle =
this->CreateObject(cmXCodeObject::PBXBuildStyle);
- if(this->XcodeVersion == 15)
- {
deployBuildStyle->AddAttribute("name", this->CreateString("Deployment"));
+ deployBuildStyle->AddAttribute("buildSettings", group);
+ listObjs->AddObject(deployBuildStyle);
}
else
{
- deployBuildStyle->AddAttribute("name", this->CreateString("Release"));
- deployBuildStyle->SetComment("Release");
+ for(unsigned int i = 0; i < this->CurrentConfigurationTypes.size(); ++i)
+ {
+ cmXCodeObject* buildStyle =
+ this->CreateObject(cmXCodeObject::PBXBuildStyle);
+ const char* name = this->CurrentConfigurationTypes[i].c_str();
+ buildStyle->AddAttribute("name", this->CreateString(name));
+ buildStyle->SetComment(name);
+ cmXCodeObject* sgroup =
+ this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
+ sgroup->AddAttribute("COPY_PHASE_STRIP", this->CreateString("NO"));
+ buildStyle->AddAttribute("buildSettings", sgroup);
+ listObjs->AddObject(buildStyle);
+ }
}
- deployBuildStyle->AddAttribute("buildSettings", group);
-
- cmXCodeObject* listObjs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
- listObjs->AddObject(developBuildStyle);
- listObjs->AddObject(deployBuildStyle);
cmXCodeObject* mainGroup = this->CreateObject(cmXCodeObject::PBXGroup);
this->MainGroupChildren =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -2013,14 +2014,40 @@ void cmGlobalXCodeGenerator::CreateXCodeObjects(cmLocalGenerator* root,
this->RootObject->AddAttribute("buildStyles", listObjs);
this->RootObject->AddAttribute("hasScannedForEncodings",
this->CreateString("0"));
- cmXCodeObject* configlist = this->CreateObject(cmXCodeObject::XCConfigurationList);
- cmXCodeObject* configDebug = this->CreateObject(cmXCodeObject::XCBuildConfiguration);
- cmXCodeObject* configRelease = this->CreateObject(cmXCodeObject::XCBuildConfiguration);
+ cmXCodeObject* configlist =
+ this->CreateObject(cmXCodeObject::XCConfigurationList);
cmXCodeObject* buildConfigurations =
this->CreateObject(cmXCodeObject::OBJECT_LIST);
- buildConfigurations->AddObject(configDebug);
- buildConfigurations->AddObject(configRelease);
+ std::vector<cmXCodeObject*> configs;
+ if(this->XcodeVersion == 15)
+ {
+ cmXCodeObject* configDebug =
+ this->CreateObject(cmXCodeObject::XCBuildConfiguration);
+ configDebug->AddAttribute("name", this->CreateString("Debug"));
+ configs.push_back(configDebug);
+ cmXCodeObject* configRelease =
+ this->CreateObject(cmXCodeObject::XCBuildConfiguration);
+ configRelease->AddAttribute("name", this->CreateString("Release"));
+ configs.push_back(configRelease);
+ }
+ else
+ {
+ for(unsigned int i = 0; i < this->CurrentConfigurationTypes.size(); ++i)
+ {
+ const char* name = this->CurrentConfigurationTypes[i].c_str();
+ cmXCodeObject* config =
+ this->CreateObject(cmXCodeObject::XCBuildConfiguration);
+ config->AddAttribute("name", this->CreateString(name));
+ configs.push_back(config);
+ }
+ }
+ for(std::vector<cmXCodeObject*>::iterator c = configs.begin();
+ c != configs.end(); ++c)
+ {
+ buildConfigurations->AddObject(*c);
+ }
configlist->AddAttribute("buildConfigurations", buildConfigurations);
+
std::string comment = "Build configuration list for PBXProject ";
comment += " \"";
comment += this->CurrentProject;
@@ -2054,11 +2081,11 @@ void cmGlobalXCodeGenerator::CreateXCodeObjects(cmLocalGenerator* root,
this->CreateString(archString.c_str()));
}
}
- configDebug->AddAttribute("name", this->CreateString("Debug"));
- configDebug->AddAttribute("buildSettings", buildSettings);
- configRelease->AddAttribute("name", this->CreateString("Release"));
- configRelease->AddAttribute("buildSettings", buildSettings);
-
+ for( std::vector<cmXCodeObject*>::iterator i = configs.begin();
+ i != configs.end(); ++i)
+ {
+ (*i)->AddAttribute("buildSettings", buildSettings);
+ }
this->RootObject->AddAttribute("buildConfigurationList",
this->CreateObjectReference(configlist));