From 0816caecac5b9e4b93ce17301e0aad2c7a9845e8 Mon Sep 17 00:00:00 2001 From: Alexander Chehovsky Date: Sat, 16 Feb 2013 14:23:20 +0100 Subject: Xcode: Fix nested source group handling (#12943) Teach the code path for nested sources build the group map key in the same way as non-nested code path does. --- Source/cmGlobalXCodeGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 9600771..cca5931 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2914,7 +2914,7 @@ cmXCodeObject* cmGlobalXCodeGenerator { std::vector folders = cmSystemTools::tokenize(sg->GetFullName(), "\\"); - cmStdString curr_folder = cmtarget.GetName(); + cmStdString curr_folder = target; curr_folder += "/"; for(std::vector::size_type i = 0; i < folders.size();i++) { -- cgit v0.12 From f6a8983db4b67cde32b9ea88c91c65bb1ef82d6c Mon Sep 17 00:00:00 2001 From: Alexander Chehovsky Date: Sat, 16 Feb 2013 14:23:21 +0100 Subject: Xcode: Sort source files Since Xcode doesn't sort the files on its own, let's sort them in our generator to make navigation easier. Visual Studio, QtCreator, and kdevelop all display files sorted. --- Source/cmGlobalXCodeGenerator.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index cca5931..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& @@ -981,7 +990,9 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, } // organize the sources - std::vector const &classes = cmtarget.GetSourceFiles(); + std::vector classes = cmtarget.GetSourceFiles(); + std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare()); + std::vector externalObjFiles; std::vector headerFiles; std::vector resourceFiles; -- cgit v0.12