mirror of
https://github.com/reactos/CMake.git
synced 2025-01-26 05:47:10 +00:00
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.
This commit is contained in:
parent
0816caecac
commit
f6a8983db4
@ -955,6 +955,15 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
struct cmSourceFilePathCompare
|
||||
{
|
||||
bool operator()(cmSourceFile* l, cmSourceFile* r)
|
||||
{
|
||||
return l->GetFullPath() < r->GetFullPath();
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user