[Cmake-commits] [cmake-commits] hoffman committed cmake.cxx 1.427 1.428
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Sep 14 22:16:46 EDT 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv29460/Source
Modified Files:
cmake.cxx
Log Message:
Fix for bug #8969, pick a better default version for VS, and make it easier to add new versions of VS to look for.
Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.427
retrieving revision 1.428
diff -C 2 -d -r1.427 -r1.428
*** cmake.cxx 14 Sep 2009 17:45:40 -0000 1.427
--- cmake.cxx 15 Sep 2009 02:16:43 -0000 1.428
***************
*** 2030,2062 ****
#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
std::string installedCompiler;
! std::string mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft"
! "\\VisualStudio\\8.0\\Setup;Dbghelp_path]";
! cmSystemTools::ExpandRegistryValues(mp);
! if (!(mp == "/registry"))
! {
! installedCompiler = "Visual Studio 8 2005";
! }
! else
{
! mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft"
! "\\VisualStudio\\7.1;InstallDir]";
! cmSystemTools::ExpandRegistryValues(mp);
! if (!(mp == "/registry"))
! {
! installedCompiler = "Visual Studio 7 .NET 2003";
! }
! else
{
! mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft"
! "\\VisualStudio\\7.0;InstallDir]";
! cmSystemTools::ExpandRegistryValues(mp);
! if (!(mp == "/registry"))
! {
! installedCompiler = "Visual Studio 7";
! }
! else
! {
! installedCompiler = "Visual Studio 6";
! }
}
}
--- 2030,2058 ----
#elif defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
std::string installedCompiler;
! // Try to find the newest VS installed on the computer and
! // use that as a default if -G is not specified
! std::string vsregBase =
! "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
! struct VSRegistryEntryName
! {
! const char* MSVersion;
! const char* GeneratorName;
! };
! VSRegistryEntryName version[] = {
! {"6.0", "Visual Studio 6"},
! {"7.0", "Visual Studio 7"},
! {"7.1", "Visual Stuido 7 .NET 2003"},
! {"8.0", "Visual Studio 8 2005"},
! {"9.0", "Visual Studio 9 2008"},
! {"10.0", "Visual Studio 10"},
! {0, 0}};
! for(int i =0; version[i].MSVersion != 0; i++)
{
! std::string reg = vsregBase + version[i].MSVersion;
! reg += ";InstallDir]";
! cmSystemTools::ExpandRegistryValues(reg);
! if (!(reg == "/registry"))
{
! installedCompiler = version[i].GeneratorName;
}
}
***************
*** 2068,2071 ****
--- 2064,2068 ----
}
this->SetGlobalGenerator(gen);
+ std::cout << "-- Building for: " << gen->GetName() << "\n";
#else
this->SetGlobalGenerator(new cmGlobalUnixMakefileGenerator3);
More information about the Cmake-commits
mailing list