Android: Fix CMake parsing for Qt 6.0.0 kits

Qt for Android 6.0 with CMake requires QT_HOST_PATH to be provided for
CMake to properly parse and configure the project.

Fixes: QTCREATORBUG-24660
Change-Id: Id5d77f900698ef4d19ec8e37b14e4e3234c74ea4
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Assam Boudjelthia
2020-09-18 18:29:03 +03:00
parent efa6f2ee4b
commit 014b90f780
3 changed files with 21 additions and 0 deletions

View File

@@ -176,6 +176,11 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Utils::Id id)
initialArgs.append(
QString::fromLatin1("-DCMAKE_FIND_ROOT_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}"));
if (qt->qtVersion() >= QtSupport::QtVersionNumber{6, 0, 0}) {
initialArgs.append(
QString::fromLatin1("-DQT_HOST_PATH:PATH=%{Qt:QT_HOST_PREFIX}"));
}
}
if (info.buildDirectory.isEmpty()) {

View File

@@ -126,6 +126,7 @@ public:
Utils::FilePath hostBinPath;
Utils::FilePath hostDataPath;
Utils::FilePath hostPrefixPath;
Abis qtAbis;
};
@@ -623,6 +624,12 @@ FilePath BaseQtVersion::hostDataPath() const // QT_HOST_DATA
return d->m_data.hostDataPath;
}
FilePath BaseQtVersion::hostPrefixPath() const // QT_HOST_PREFIX
{
d->updateVersionInfo();
return d->m_data.hostPrefixPath;
}
FilePath BaseQtVersion::mkspecsPath() const
{
const FilePath result = hostDataPath();
@@ -1267,6 +1274,7 @@ void BaseQtVersionPrivate::updateVersionInfo()
m_data.hostBinPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_BINS"));
m_data.hostDataPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_DATA"));
m_data.hostPrefixPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_PREFIX"));
const QString qtInstallBins = q->binPath().toString();
const QString qtHeaderData = q->headerPath().toString();
@@ -1445,6 +1453,13 @@ BaseQtVersion::createMacroExpander(const std::function<const BaseQtVersion *()>
return version->dataPath().toString();
}));
expander->registerVariable("Qt:QT_HOST_PREFIX",
QtKitAspect::tr(
"The host location of the current Qt version."),
versionProperty([](const BaseQtVersion *version) {
return version->hostPrefixPath().toString();
}));
expander->registerVariable(
"Qt:QT_INSTALL_HEADERS",
QtKitAspect::tr("The installation location of the current Qt version's header files."),

View File

@@ -212,6 +212,7 @@ public:
Utils::FilePath hostBinPath() const;
Utils::FilePath hostDataPath() const;
Utils::FilePath hostPrefixPath() const;
Utils::FilePath mkspecsPath() const;
Utils::FilePath qmlBinPath() const;