summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-02-20 13:09:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-02-20 13:09:17 (GMT)
commit414658f0572497fffcb865485f08cd2d26ce040f (patch)
treee09a7d3788a2b0e013468a84d2aeb8ee85d350f2
parent4515b09731856dc2713c567a48fec1374b317ece (diff)
parentf6a8983db4b67cde32b9ea88c91c65bb1ef82d6c (diff)
downloadCMake-414658f0572497fffcb865485f08cd2d26ce040f.zip
CMake-414658f0572497fffcb865485f08cd2d26ce040f.tar.gz
CMake-414658f0572497fffcb865485f08cd2d26ce040f.tar.bz2
Merge topic 'xcode-organize-sources'
f6a8983 Xcode: Sort source files 0816cae Xcode: Fix nested source group handling (#12943)
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 9600771..7cc1287 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -956,6 +956,15 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
}
//----------------------------------------------------------------------------
+struct cmSourceFilePathCompare
+{
+ bool operator()(cmSourceFile* l, cmSourceFile* r)
+ {
+ return l->GetFullPath() < r->GetFullPath();
+ }
+};
+
+//----------------------------------------------------------------------------
void
cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmXCodeObject*>&
@@ -981,7 +990,9 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
}
// organize the sources
- std::vector<cmSourceFile*> const &classes = cmtarget.GetSourceFiles();
+ std::vector<cmSourceFile*> classes = cmtarget.GetSourceFiles();
+ std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare());
+
std::vector<cmXCodeObject*> externalObjFiles;
std::vector<cmXCodeObject*> headerFiles;
std::vector<cmXCodeObject*> resourceFiles;
@@ -2914,7 +2925,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
{
std::vector<std::string> folders =
cmSystemTools::tokenize(sg->GetFullName(), "\\");
- cmStdString curr_folder = cmtarget.GetName();
+ cmStdString curr_folder = target;
curr_folder += "/";
for(std::vector<std::string>::size_type i = 0; i < folders.size();i++)
{