summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index f067d8f..b155f5b 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -520,6 +520,7 @@ std::string cmGlobalVisualStudio7Generator::ConvertToSolutionPath(
void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
std::ostream& fout, cmLocalGenerator* root)
{
+ std::string const guid = this->GetGUID(root->GetProjectName() + ".sln");
bool extensibilityGlobalsOverridden = false;
bool extensibilityAddInsOverridden = false;
const std::vector<std::string> propKeys =
@@ -538,11 +539,14 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
} else
continue;
if (!name.empty()) {
- if (name == "ExtensibilityGlobals" && sectionType == "postSolution")
+ bool addGuid = false;
+ if (name == "ExtensibilityGlobals" && sectionType == "postSolution") {
+ addGuid = true;
extensibilityGlobalsOverridden = true;
- else if (name == "ExtensibilityAddIns" &&
- sectionType == "postSolution")
+ } else if (name == "ExtensibilityAddIns" &&
+ sectionType == "postSolution") {
extensibilityAddInsOverridden = true;
+ }
fout << "\tGlobalSection(" << name << ") = " << sectionType << "\n";
std::vector<std::string> keyValuePairs;
cmSystemTools::ExpandListArgument(
@@ -557,15 +561,23 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
const std::string value =
cmSystemTools::TrimWhitespace(itPair->substr(posEqual + 1));
fout << "\t\t" << key << " = " << value << "\n";
+ if (key == "SolutionGuid") {
+ addGuid = false;
+ }
}
}
+ if (addGuid) {
+ fout << "\t\tSolutionGuid = {" << guid << "}\n";
+ }
fout << "\tEndGlobalSection\n";
}
}
}
- if (!extensibilityGlobalsOverridden)
+ if (!extensibilityGlobalsOverridden) {
fout << "\tGlobalSection(ExtensibilityGlobals) = postSolution\n"
+ << "\t\tSolutionGuid = {" << guid << "}\n"
<< "\tEndGlobalSection\n";
+ }
if (!extensibilityAddInsOverridden)
fout << "\tGlobalSection(ExtensibilityAddIns) = postSolution\n"
<< "\tEndGlobalSection\n";