Fix qmake evaluation of QMAKE_TARGET.arch on msvc2010 x86_64

This change is needed because msvc2010 tools have a '\' character at
the end of environment variable VCINSTALLDIR. This variable on msvc2008
does not have this '\' character at its end. Without this change
QMAKE_TARGET.arch on msvc2010 x64 evaluates to x86 instead of x86_64.

Task-number: QTBUG-22686

Change-Id: Ifba833e9361c97568b8b3de9976023e8537b208a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
Giotis Nikos 2012-02-07 01:32:44 +02:00 committed by Qt by Nokia
parent b113644acb
commit 6b807a283c

View File

@ -3165,8 +3165,14 @@ QStringList &QMakeProject::values(const QString &_var, QHash<QString, QStringLis
QString ret, type = var.mid(13);
if(type == "arch") {
QString paths = qgetenv("PATH");
QString vcBin64 = qgetenv("VCINSTALLDIR").append("\\bin\\amd64");
QString vcBinX86_64 = qgetenv("VCINSTALLDIR").append("\\bin\\x86_amd64");
QString vcBin64 = qgetenv("VCINSTALLDIR");
if (!vcBin64.endsWith('\\'))
vcBin64.append('\\');
vcBin64.append("bin\\amd64");
QString vcBinX86_64 = qgetenv("VCINSTALLDIR");
if (!vcBinX86_64.endsWith('\\'))
vcBinX86_64.append('\\');
vcBinX86_64.append("bin\\x86_amd64");
if(paths.contains(vcBin64,Qt::CaseInsensitive) || paths.contains(vcBinX86_64,Qt::CaseInsensitive))
ret = "x86_64";
else