QmakeProjectManager: Extend Qt examples deployment hack

E.g. for Qnx, QT_INSTALL_PREFIX is not a prefix of QT_INSTALL_EXAMPLES.

Fixes: QTCREATORBUG-22592
Change-Id: I3092cd76af01519783e1162ab8e79caaf0836f00
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-12-10 16:32:18 +01:00
parent be9cad77d2
commit 77126dc4b8

View File

@@ -1951,11 +1951,12 @@ InstallsList QmakeProFile::installsList(const QtSupport::ProFileReader *reader,
if (itemList.isEmpty()) if (itemList.isEmpty())
return result; return result;
const QString installPrefix const QStringList installPrefixVars{"QT_INSTALL_PREFIX", "QT_INSTALL_EXAMPLES"};
= reader->propertyValue(QLatin1String("QT_INSTALL_PREFIX")); QList<QPair<QString, QString>> installPrefixValues;
const QString devInstallPrefix for (const QString &installPrefix : installPrefixVars) {
= reader->propertyValue(QLatin1String("QT_INSTALL_PREFIX/dev")); installPrefixValues << qMakePair(reader->propertyValue(installPrefix),
bool fixInstallPrefix = (installPrefix != devInstallPrefix); reader->propertyValue(installPrefix + "/dev"));
}
foreach (const QString &item, itemList) { foreach (const QString &item, itemList) {
const QStringList config = reader->values(item + ".CONFIG"); const QStringList config = reader->values(item + ".CONFIG");
@@ -1974,13 +1975,18 @@ InstallsList QmakeProFile::installsList(const QtSupport::ProFileReader *reader,
} }
QString itemPath = itemPaths.last(); QString itemPath = itemPaths.last();
if (fixInstallPrefix && itemPath.startsWith(installPrefix)) { for (const auto &prefixValuePair : qAsConst(installPrefixValues)) {
if (prefixValuePair.first == prefixValuePair.second
|| !itemPath.startsWith(prefixValuePair.first)) {
continue;
}
// This is a hack for projects which install into $$[QT_INSTALL_*], // This is a hack for projects which install into $$[QT_INSTALL_*],
// in particular Qt itself, examples being most relevant. // in particular Qt itself, examples being most relevant.
// Projects which implement their own install path policy must // Projects which implement their own install path policy must
// parametrize their INSTALLS themselves depending on the intended // parametrize their INSTALLS themselves depending on the intended
// installation/deployment mode. // installation/deployment mode.
itemPath.replace(0, installPrefix.length(), devInstallPrefix); itemPath.replace(0, prefixValuePair.first.length(), prefixValuePair.second);
break;
} }
if (item == QLatin1String("target")) { if (item == QLatin1String("target")) {
if (active) if (active)