summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-07-27 17:40:47 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-07-27 17:40:47 (GMT)
commit2a8b05b69d2db9b4c24db73f8e5a662747ec312b (patch)
tree65011facaa20043c8c373a17569eb71b375188d4 /Source
parent07231d014cdfedcd259e0fd6ea0c1602b695653b (diff)
downloadCMake-2a8b05b69d2db9b4c24db73f8e5a662747ec312b.zip
CMake-2a8b05b69d2db9b4c24db73f8e5a662747ec312b.tar.gz
CMake-2a8b05b69d2db9b4c24db73f8e5a662747ec312b.tar.bz2
BUG: fix for bug 971, pick a better generator from the command line
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx36
1 files changed, 35 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index a90356c..de6aebf 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1032,7 +1032,41 @@ int cmake::Configure()
#if defined(__BORLANDC__) && defined(_WIN32)
this->SetGlobalGenerator(new cmGlobalBorlandMakefileGenerator);
#elif defined(_WIN32) && !defined(__CYGWIN__)
- this->SetGlobalGenerator(new cmGlobalVisualStudio6Generator);
+ 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";
+ }
+ }
+ }
+ cmGlobalGenerator* gen = this->CreateGlobalGenerator(installedCompiler.c_str());
+ if(!gen)
+ {
+ gen = new cmGlobalNMakeMakefileGenerator;
+ }
+ this->SetGlobalGenerator(gen);
#else
this->SetGlobalGenerator(new cmGlobalUnixMakefileGenerator);
#endif