From d1101c460e173e3554fa4e5c800ab3e82ddc3aad Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 1 Mar 2021 15:31:42 +0100 Subject: Simplify prefix-related functionality of qmake Since the QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH and QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH definitions keep the same value in modern CMake build, no need to have special handling in cases where these values are used in qmake. Also it will be useful to specify the relative path to the prefix directory from the directories different of 'bin' when use QMakeLibraryInfo. Task-number: QTBUG-75870 Change-Id: I5a777001eb334dcf05e22853a514d4257352d59b Reviewed-by: Joerg Bornemann --- qmake/qmakelibraryinfo.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'qmake/qmakelibraryinfo.cpp') diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 273da190d4..ac8d191248 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -139,26 +139,11 @@ void QMakeLibraryInfo::sysrootify(QString &path) } } -static QString getPrefixFromHostBinDir(const char *hostBinDirToPrefixPath) +static QString getPrefix() { const QString canonicalQMakePath = QFileInfo(qmake_abslocation()).canonicalPath(); return QDir::cleanPath(canonicalQMakePath + QLatin1Char('/') - + QLatin1String(hostBinDirToPrefixPath)); -} - -static QString getExtPrefixFromHostBinDir() -{ - return getPrefixFromHostBinDir(QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH); -} - -static QString getHostPrefixFromHostBinDir() -{ - return getPrefixFromHostBinDir(QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH); -} - -static QString getPrefix() -{ - return getExtPrefixFromHostBinDir(); + + QLatin1String(QT_CONFIGURE_RELATIVE_PREFIX_PATH)); } QString QMakeLibraryInfo::path(int loc) @@ -271,7 +256,7 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group path = QT_CONFIGURE_SETTINGS_PATH; #endif } else if (loc == HostPrefixPath) { - static const QByteArray hostPrefixPath = getHostPrefixFromHostBinDir().toLatin1(); + static const QByteArray hostPrefixPath = getPrefix().toLatin1(); path = hostPrefixPath.constData(); } -- cgit v1.2.3