summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-15 15:49:43 (GMT)
committerBrad King <brad.king@kitware.com>2017-11-15 15:52:33 (GMT)
commitf26009dde6b152f1d32e676202c8982ec409938a (patch)
tree41d8cb46a400543fad61c6014c034eb671b2fbc2 /Source/cmVisualStudio10TargetGenerator.cxx
parentc871446abc9f9f33bd302ed059037d719eb9e2d9 (diff)
downloadCMake-f26009dde6b152f1d32e676202c8982ec409938a.zip
CMake-f26009dde6b152f1d32e676202c8982ec409938a.tar.gz
CMake-f26009dde6b152f1d32e676202c8982ec409938a.tar.bz2
VS: Order .vcxproj.filters files deterministically
Sort source groups by name rather than arbitrary pointer values. Fixes: #17446
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b2ac932..caeeeb9 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1469,9 +1469,12 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
}
this->WriteString("<ItemGroup>\n", 1);
- for (std::set<cmSourceGroup*>::iterator g = groupsUsed.begin();
- g != groupsUsed.end(); ++g) {
- cmSourceGroup* sg = *g;
+ std::vector<cmSourceGroup*> groupsVec(groupsUsed.begin(), groupsUsed.end());
+ std::sort(groupsVec.begin(), groupsVec.end(),
+ [](cmSourceGroup* l, cmSourceGroup* r) {
+ return l->GetFullName() < r->GetFullName();
+ });
+ for (cmSourceGroup* sg : groupsVec) {
std::string const& name = sg->GetFullName();
if (!name.empty()) {
this->WriteString("<Filter Include=\"", 2);