From c677838c1a608dd182b238154050a94ab79d6bc4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 25 Mar 2013 13:30:46 -0400 Subject: [PATCH] VS: Fix VS 10/11 .sln headers (#14038) The VS version we generate in the .sln header is used by VS when opening the file through Windows Explorer and possibly elsewhere. Fix our generators to use version strings known to VS to avoid a drop-down box. For VS 10, since commit 4f96af44 (Fix VS 10 .sln files for Windows Explorer, 2009-10-22) we use "Visual Studio 2010" instead of just "Visual Studio 10". This is correct except that for the Express edition we need "Visual C++ Express 2010". For VS 11, since commit f0d66ab4 (VS11: Fix comment generated at the top of *.sln files, 2011-10-20) we use "Visual Studio 11" in the .sln header but the preferred value is "Visual Studio 2012" (just as the first commit mentioned above fixed for VS 10). Also for the Express edition we need "Visual Studio Express 2012 for Windows Desktop". --- Source/cmGlobalVisualStudio10Generator.cxx | 9 ++++++++- Source/cmGlobalVisualStudio11Generator.cxx | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index cac72fc4d..b8c493916 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -102,7 +102,14 @@ void cmGlobalVisualStudio10Generator::AddPlatformDefinitions(cmMakefile* mf) void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout) { fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n"; - fout << "# Visual Studio 2010\n"; + if (this->ExpressEdition) + { + fout << "# Visual C++ Express 2010\n"; + } + else + { + fout << "# Visual Studio 2010\n"; + } } ///! Create a local generator appropriate to this Global Generator diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index b6d7d0452..299aaa8b9 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -81,7 +81,14 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout) { fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; - fout << "# Visual Studio 11\n"; + if (this->ExpressEdition) + { + fout << "# Visual Studio Express 2012 for Windows Desktop\n"; + } + else + { + fout << "# Visual Studio 2012\n"; + } } //----------------------------------------------------------------------------