diff options
author | Alexander Chehovsky <madfishtheone@gmail.com> | 2013-02-16 13:23:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-18 13:47:14 (GMT) |
commit | f6a8983db4b67cde32b9ea88c91c65bb1ef82d6c (patch) | |
tree | b6eaeb0697636329aaaa5ffbc9319ee229df2008 /Source | |
parent | 0816caecac5b9e4b93ce17301e0aad2c7a9845e8 (diff) | |
download | CMake-f6a8983db4b67cde32b9ea88c91c65bb1ef82d6c.zip CMake-f6a8983db4b67cde32b9ea88c91c65bb1ef82d6c.tar.gz CMake-f6a8983db4b67cde32b9ea88c91c65bb1ef82d6c.tar.bz2 |
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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
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<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; |