Commit 958672e4 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

find qmakespecs in source directory of shadow built qt



qt 5.2 does not copy the qmakespecs to the build directory any more.
a fallback to the /get property variant ensures that other build types
continue to work. consequently, this has no effect whatsoever on
installed qt versions.

(based on qtbase/214b55d5d4c8fdf975b3c36f69bac4b07d8d39d0)

Task-number: QTCREATORBUG-9572
Change-Id: I9edac11f8997fcb0594d0a67419d4733dd4ed86b
Reviewed-by: default avatarMitch Curtis <mitch.curtis@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent dc5a0e3e
...@@ -992,9 +992,11 @@ QHash<QString,QString> BaseQtVersion::versionInfo() const ...@@ -992,9 +992,11 @@ QHash<QString,QString> BaseQtVersion::versionInfo() const
return m_versionInfo; return m_versionInfo;
} }
QString BaseQtVersion::qmakeProperty(const QHash<QString,QString> &versionInfo, const QByteArray &name) QString BaseQtVersion::qmakeProperty(const QHash<QString,QString> &versionInfo, const QByteArray &name,
PropertyVariant variant)
{ {
QString val = versionInfo.value(QString::fromLatin1(name + "/get")); QString val = versionInfo.value(QString::fromLatin1(
name + (variant == PropertyVariantGet ? "/get" : "/src")));
if (!val.isNull()) if (!val.isNull())
return val; return val;
return versionInfo.value(QString::fromLatin1(name)); return versionInfo.value(QString::fromLatin1(name));
...@@ -1354,7 +1356,7 @@ bool BaseQtVersion::queryQMakeVariables(const FileName &binary, const Environmen ...@@ -1354,7 +1356,7 @@ bool BaseQtVersion::queryQMakeVariables(const FileName &binary, const Environmen
FileName BaseQtVersion::mkspecDirectoryFromVersionInfo(const QHash<QString, QString> &versionInfo) FileName BaseQtVersion::mkspecDirectoryFromVersionInfo(const QHash<QString, QString> &versionInfo)
{ {
QString dataDir = qmakeProperty(versionInfo, "QT_HOST_DATA"); QString dataDir = qmakeProperty(versionInfo, "QT_HOST_DATA", PropertyVariantSrc);
if (dataDir.isEmpty()) if (dataDir.isEmpty())
return FileName(); return FileName();
return FileName::fromUserInput(dataDir + QLatin1String("/mkspecs")); return FileName::fromUserInput(dataDir + QLatin1String("/mkspecs"));
......
...@@ -121,7 +121,9 @@ public: ...@@ -121,7 +121,9 @@ public:
// Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information // Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information
QHash<QString,QString> versionInfo() const; QHash<QString,QString> versionInfo() const;
static QString qmakeProperty(const QHash<QString,QString> &versionInfo, const QByteArray &name); enum PropertyVariant { PropertyVariantGet, PropertyVariantSrc };
static QString qmakeProperty(const QHash<QString,QString> &versionInfo, const QByteArray &name,
PropertyVariant variant = PropertyVariantGet);
QString qmakeProperty(const QByteArray &name) const; QString qmakeProperty(const QByteArray &name) const;
virtual void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const; virtual void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const;
virtual Utils::Environment qmakeRunEnvironment() const; virtual Utils::Environment qmakeRunEnvironment() const;
......
...@@ -1418,6 +1418,7 @@ void QMakeEvaluator::updateMkspecPaths() ...@@ -1418,6 +1418,7 @@ void QMakeEvaluator::updateMkspecPaths()
ret << m_sourceRoot + concat; ret << m_sourceRoot + concat;
ret << m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + concat; ret << m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + concat;
ret << m_option->propertyValue(ProKey("QT_HOST_DATA/src")) + concat;
ret.removeDuplicates(); ret.removeDuplicates();
m_mkspecPaths = ret; m_mkspecPaths = ret;
...@@ -1471,6 +1472,7 @@ void QMakeEvaluator::updateFeaturePaths() ...@@ -1471,6 +1472,7 @@ void QMakeEvaluator::updateFeaturePaths()
} }
feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + mkspecs_concat); feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + mkspecs_concat);
feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/src")) + mkspecs_concat);
foreach (const QString &fb, feature_bases) { foreach (const QString &fb, feature_bases) {
foreach (const ProString &sfx, values(ProKey("QMAKE_PLATFORM"))) foreach (const ProString &sfx, values(ProKey("QMAKE_PLATFORM")))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment