Commit 1f3f7262 authored by Takumi ASAKI's avatar Takumi ASAKI Committed by Tobias Hunger

QMake: Check $QT_HOST_DATA/mkspecs for cross-compiled Qt5

mkspecs for cross-compiled Qt5 is installed to $QT_HOST_DATA/mkspecs
instead of $QT_INSTALL_DATA/mkspecs.

Change-Id: Id8d64946d542d8b587bd1c2d4f79e9f8a843bfbe
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 3383a727
......@@ -672,10 +672,7 @@ void BaseQtVersion::updateMkspec() const
if (m_mkspecFullPath.isEmpty())
return;
Utils::FileName baseMkspecDir = Utils::FileName::fromUserInput(versionInfo().value(QLatin1String("QMAKE_MKSPECS")));
if (baseMkspecDir.isEmpty())
baseMkspecDir = Utils::FileName::fromUserInput(versionInfo().value(QLatin1String("QT_INSTALL_DATA"))
+ QLatin1String("/mkspecs"));
Utils::FileName baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo());
if (m_mkspec.isChildOf(baseMkspecDir)) {
m_mkspec = m_mkspec.relativeChildPath(baseMkspecDir);
......@@ -1154,11 +1151,22 @@ bool BaseQtVersion::queryQMakeVariables(const Utils::FileName &binary, QHash<QSt
return true;
}
Utils::FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo)
Utils::FileName BaseQtVersion::mkspecDirectoryFromVersionInfo(const QHash<QString, QString> &versionInfo)
{
Utils::FileName baseMkspecDir = Utils::FileName::fromUserInput(versionInfo.value(QLatin1String("QMAKE_MKSPECS")));
if (baseMkspecDir.isEmpty())
baseMkspecDir = Utils::FileName::fromUserInput(versionInfo.value(QLatin1String("QT_INSTALL_DATA")) + QLatin1String("/mkspecs"));
if (baseMkspecDir.isEmpty()) {
baseMkspecDir = Utils::FileName::fromUserInput(versionInfo.value(QLatin1String("QT_HOST_DATA")));
if (baseMkspecDir.isEmpty())
baseMkspecDir = Utils::FileName::fromUserInput(versionInfo.value(QLatin1String("QT_INSTALL_DATA")));
if (!baseMkspecDir.isEmpty())
baseMkspecDir.appendPath("mkspecs");
}
return baseMkspecDir;
}
Utils::FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo)
{
Utils::FileName baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo);
if (baseMkspecDir.isEmpty())
return Utils::FileName();
......
......@@ -191,6 +191,7 @@ public:
static bool queryQMakeVariables(const Utils::FileName &binary, QHash<QString, QString> *versionInfo);
static bool queryQMakeVariables(const Utils::FileName &binary, QHash<QString, QString> *versionInfo, bool *qmakeIsExecutable);
static Utils::FileName mkspecDirectoryFromVersionInfo(const QHash<QString, QString> &versionInfo);
static Utils::FileName mkspecFromVersionInfo(const QHash<QString, QString> &versionInfo);
......
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