forked from qt-creator/qt-creator
Detect MSVC 2010.
Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com> Task-number: QTCREATORBUG-1710
This commit is contained in:
@@ -431,12 +431,26 @@ MSVCToolChain::InstallationList MSVCToolChain::installations()
|
|||||||
// 2) Installed MSVCs
|
// 2) Installed MSVCs
|
||||||
const QSettings vsRegistry(MSVC_RegKey, QSettings::NativeFormat);
|
const QSettings vsRegistry(MSVC_RegKey, QSettings::NativeFormat);
|
||||||
foreach(const QString &vsName, vsRegistry.allKeys()) {
|
foreach(const QString &vsName, vsRegistry.allKeys()) {
|
||||||
if (vsName.contains(QLatin1Char('.'))) { // Scan for version major.minor
|
const int dotPos = vsName.indexOf(QLatin1Char('.'));
|
||||||
|
if (dotPos != -1) { // Scan for version major.minor
|
||||||
const QString path = vsRegistry.value(vsName).toString();
|
const QString path = vsRegistry.value(vsName).toString();
|
||||||
|
const int version = vsName.left(dotPos).toInt();
|
||||||
// Check existence of various install scripts
|
// Check existence of various install scripts
|
||||||
const QString vcvars32bat = path + QLatin1String("bin\\vcvars32.bat");
|
const QString vcvars32bat = path + QLatin1String("bin\\vcvars32.bat");
|
||||||
if (QFileInfo(vcvars32bat).isFile())
|
if (QFileInfo(vcvars32bat).isFile())
|
||||||
installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvars32bat));
|
installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvars32bat));
|
||||||
|
if (version >= 10) {
|
||||||
|
// Just one common file
|
||||||
|
const QString vcvarsAllbat = path + QLatin1String("vcvarsall.bat");
|
||||||
|
if (QFileInfo(vcvarsAllbat).isFile()) {
|
||||||
|
installs.push_back(Installation(Installation::VS, vsName, Installation::s32, vcvarsAllbat, QLatin1String("x86")));
|
||||||
|
installs.push_back(Installation(Installation::VS, vsName, Installation::amd64, vcvarsAllbat, QLatin1String("amd64")));
|
||||||
|
installs.push_back(Installation(Installation::VS, vsName, Installation::s64, vcvarsAllbat, QLatin1String("x64")));
|
||||||
|
installs.push_back(Installation(Installation::VS, vsName, Installation::ia64, vcvarsAllbat, QLatin1String("ia64")));
|
||||||
|
} else {
|
||||||
|
qWarning("Unable to find MSVC setup script %s in version %d", qPrintable(vcvarsAllbat), version);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
// Amd 64 is the preferred 64bit platform
|
// Amd 64 is the preferred 64bit platform
|
||||||
const QString vcvarsAmd64bat = path + QLatin1String("bin\\amd64\\vcvarsamd64.bat");
|
const QString vcvarsAmd64bat = path + QLatin1String("bin\\amd64\\vcvarsamd64.bat");
|
||||||
if (QFileInfo(vcvarsAmd64bat).isFile())
|
if (QFileInfo(vcvarsAmd64bat).isFile())
|
||||||
@@ -453,6 +467,7 @@ MSVCToolChain::InstallationList MSVCToolChain::installations()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (debug)
|
if (debug)
|
||||||
foreach(const Installation &i, installs)
|
foreach(const Installation &i, installs)
|
||||||
qDebug() << i;
|
qDebug() << i;
|
||||||
|
|||||||
Reference in New Issue
Block a user