|
@@ -1469,11 +1469,14 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this->WriteString("<ItemGroup>\n", 1);
|
|
this->WriteString("<ItemGroup>\n", 1);
|
|
|
- for (std::set<cmSourceGroup*>::iterator g = groupsUsed.begin();
|
|
|
|
|
- g != groupsUsed.end(); ++g) {
|
|
|
|
|
- cmSourceGroup* sg = *g;
|
|
|
|
|
- const char* name = sg->GetFullName();
|
|
|
|
|
- if (strlen(name) != 0) {
|
|
|
|
|
|
|
+ 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);
|
|
this->WriteString("<Filter Include=\"", 2);
|
|
|
(*this->BuildFileStream) << name << "\">\n";
|
|
(*this->BuildFileStream) << name << "\">\n";
|
|
|
std::string guidName = "SG_Filter_";
|
|
std::string guidName = "SG_Filter_";
|
|
@@ -1558,12 +1561,12 @@ void cmVisualStudio10TargetGenerator::WriteGroupSources(
|
|
|
std::string const& source = sf->GetFullPath();
|
|
std::string const& source = sf->GetFullPath();
|
|
|
cmSourceGroup* sourceGroup =
|
|
cmSourceGroup* sourceGroup =
|
|
|
this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
|
|
this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
|
|
|
- const char* filter = sourceGroup->GetFullName();
|
|
|
|
|
|
|
+ std::string const& filter = sourceGroup->GetFullName();
|
|
|
this->WriteString("<", 2);
|
|
this->WriteString("<", 2);
|
|
|
std::string path = this->ConvertPath(source, s->RelativePath);
|
|
std::string path = this->ConvertPath(source, s->RelativePath);
|
|
|
this->ConvertToWindowsSlash(path);
|
|
this->ConvertToWindowsSlash(path);
|
|
|
(*this->BuildFileStream) << name << " Include=\"" << cmVS10EscapeXML(path);
|
|
(*this->BuildFileStream) << name << " Include=\"" << cmVS10EscapeXML(path);
|
|
|
- if (strlen(filter)) {
|
|
|
|
|
|
|
+ if (!filter.empty()) {
|
|
|
(*this->BuildFileStream) << "\">\n";
|
|
(*this->BuildFileStream) << "\">\n";
|
|
|
this->WriteString("<Filter>", 3);
|
|
this->WriteString("<Filter>", 3);
|
|
|
(*this->BuildFileStream) << filter << "</Filter>\n";
|
|
(*this->BuildFileStream) << filter << "</Filter>\n";
|