Merge topic 'stable-xcode-projects'

6693590f Xcode: Refine quoting rules for Strings
a6331eb8 Xcode: Let PrintComment decide if the comment is non-empty
6e8952c1 Xcode: PrintComment will prepend a whitespace itself before the comment
4bd2544b Xcode: Do not add whitespace after attribute group opening brace
5cb4c838 Xcode: Properly indent PBXFileReference and PBXBuildFile
a723427b Xcode: Remove extra space in PBXProject comment
2fe8bca5 Xcode: Add comment after root object
2e0e205e Xcode: Indent using tabs
7b68c8df Xcode: Sort Xcode objects by Id
This commit is contained in:
Brad King
2015-04-20 14:02:48 -04:00
committed by CMake Topic Stage
5 changed files with 38 additions and 16 deletions
+19 -2
View File
@@ -591,6 +591,20 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
mf->GetHomeOutputDirectory()) << "\n";
}
//----------------------------------------------------------------------------
static bool objectIdLessThan(cmXCodeObject* l, cmXCodeObject* r)
{
return l->GetId() < r->GetId();
}
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::SortXCodeObjects()
{
std::sort(this->XCodeObjects.begin(), this->XCodeObjects.end(),
objectIdLessThan);
}
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::ClearXCodeObjects()
{
@@ -3372,7 +3386,7 @@ bool cmGlobalXCodeGenerator
}
configlist->AddAttribute("buildConfigurations", buildConfigurations);
std::string comment = "Build configuration list for PBXProject ";
std::string comment = "Build configuration list for PBXProject";
comment += " \"";
comment += this->CurrentProject;
comment += "\"";
@@ -3713,6 +3727,8 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmLocalGenerator* ,
std::vector<cmLocalGenerator*>& )
{
SortXCodeObjects();
fout << "// !$*UTF8*$!\n";
fout << "{\n";
cmXCodeObject::Indent(1, fout);
@@ -3740,7 +3756,8 @@ cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmXCodeObject::PrintList(this->XCodeObjects, fout);
}
cmXCodeObject::Indent(1, fout);
fout << "rootObject = " << this->RootObject->GetId() << ";\n";
fout << "rootObject = " << this->RootObject->GetId()
<< " /* Project object */;\n";
fout << "}\n";
}