BUG: fix for bug 971, pick a better generator from the command line

This commit is contained in:
Bill Hoffman 2004-07-27 13:40:47 -04:00
parent 07231d014c
commit 2a8b05b69d
1 changed files with 35 additions and 1 deletions

View File

@ -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