forked from qt-creator/qt-creator
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:
@@ -176,6 +176,11 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Utils::Id id)
|
|||||||
|
|
||||||
initialArgs.append(
|
initialArgs.append(
|
||||||
QString::fromLatin1("-DCMAKE_FIND_ROOT_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}"));
|
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()) {
|
if (info.buildDirectory.isEmpty()) {
|
||||||
|
@@ -126,6 +126,7 @@ public:
|
|||||||
|
|
||||||
Utils::FilePath hostBinPath;
|
Utils::FilePath hostBinPath;
|
||||||
Utils::FilePath hostDataPath;
|
Utils::FilePath hostDataPath;
|
||||||
|
Utils::FilePath hostPrefixPath;
|
||||||
|
|
||||||
Abis qtAbis;
|
Abis qtAbis;
|
||||||
};
|
};
|
||||||
@@ -623,6 +624,12 @@ FilePath BaseQtVersion::hostDataPath() const // QT_HOST_DATA
|
|||||||
return d->m_data.hostDataPath;
|
return d->m_data.hostDataPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilePath BaseQtVersion::hostPrefixPath() const // QT_HOST_PREFIX
|
||||||
|
{
|
||||||
|
d->updateVersionInfo();
|
||||||
|
return d->m_data.hostPrefixPath;
|
||||||
|
}
|
||||||
|
|
||||||
FilePath BaseQtVersion::mkspecsPath() const
|
FilePath BaseQtVersion::mkspecsPath() const
|
||||||
{
|
{
|
||||||
const FilePath result = hostDataPath();
|
const FilePath result = hostDataPath();
|
||||||
@@ -1267,6 +1274,7 @@ void BaseQtVersionPrivate::updateVersionInfo()
|
|||||||
|
|
||||||
m_data.hostBinPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_BINS"));
|
m_data.hostBinPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_BINS"));
|
||||||
m_data.hostDataPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_DATA"));
|
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 qtInstallBins = q->binPath().toString();
|
||||||
const QString qtHeaderData = q->headerPath().toString();
|
const QString qtHeaderData = q->headerPath().toString();
|
||||||
@@ -1445,6 +1453,13 @@ BaseQtVersion::createMacroExpander(const std::function<const BaseQtVersion *()>
|
|||||||
return version->dataPath().toString();
|
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(
|
expander->registerVariable(
|
||||||
"Qt:QT_INSTALL_HEADERS",
|
"Qt:QT_INSTALL_HEADERS",
|
||||||
QtKitAspect::tr("The installation location of the current Qt version's header files."),
|
QtKitAspect::tr("The installation location of the current Qt version's header files."),
|
||||||
|
@@ -212,6 +212,7 @@ public:
|
|||||||
|
|
||||||
Utils::FilePath hostBinPath() const;
|
Utils::FilePath hostBinPath() const;
|
||||||
Utils::FilePath hostDataPath() const;
|
Utils::FilePath hostDataPath() const;
|
||||||
|
Utils::FilePath hostPrefixPath() const;
|
||||||
|
|
||||||
Utils::FilePath mkspecsPath() const;
|
Utils::FilePath mkspecsPath() const;
|
||||||
Utils::FilePath qmlBinPath() const;
|
Utils::FilePath qmlBinPath() const;
|
||||||
|
Reference in New Issue
Block a user