From 50c9f209bf4a943a58b3f44564873a27f863e75a Mon Sep 17 00:00:00 2001
From: herbst <template.meta.programmer@googlemail.com>
Date: Fri, 22 Jan 2010 19:11:33 +0000
Subject: [PATCH] solution name can now be set (CMAKE_SOLUTION_NAME)

---
 Source/cmGlobalVisualStudio7Generator.cxx |    8 +++++++-
 Source/cmGlobalVisualStudioGenerator.cxx  |    8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 9631e9a..4c9de19 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -209,7 +209,13 @@ void cmGlobalVisualStudio7Generator
   this->CurrentProject = root->GetMakefile()->GetProjectName();
   std::string fname = root->GetMakefile()->GetStartOutputDirectory();
   fname += "/";
-  fname += root->GetMakefile()->GetProjectName();
+
+  const char* solutionName = root->GetMakefile()->GetDefinition("CMAKE_SOLUTION_NAME");
+  if(solutionName)
+    fname += solutionName;
+  else
+    fname += root->GetMakefile()->GetProjectName();
+
   fname += ".sln";
   cmGeneratedFileStream fout(fname.c_str());
   fout.SetCopyIfDifferent(true);
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 85b4a71..9167fca 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -174,7 +174,13 @@ cmGlobalVisualStudioGenerator
         {
         topLevelSlnName = mf->GetStartOutputDirectory();
         topLevelSlnName += "/";
-        topLevelSlnName += mf->GetProjectName();
+
+        const char* solutionName = mf->GetDefinition("CMAKE_SOLUTION_NAME");
+        if(solutionName)
+          topLevelSlnName += solutionName;
+        else
+          topLevelSlnName += mf->GetProjectName();
+
         topLevelSlnName += ".sln";
         }
 
-- 
1.6.5.1.1367.gcd48

