diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-04-28 14:37:15 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2022-05-09 08:32:04 +0200 |
commit | fc16855eaa393bc00c41c99bd967bc736939850d (patch) | |
tree | 25a3c74830fba7a8bcc5cde6f333ed6d732c84bf /qmake | |
parent | 277c23956cd4a298a57dad9e777259680a520730 (diff) |
Fix qmake/qtpaths -query for static relocatable builds
The install prefix was determined incorrectly for static relocatable
builds. The reason was that for those builds, QLibraryInfo::path()
returns the application directory, which is <prefix>/bin for qmake and
qtpaths.
Fix this by removing the bin directory part from the installation prefix
that QLibraryInfo returns if qmake/qtpaths are used.
Fixes: QTBUG-102877
Change-Id: I2e9ff96ded0ee2a7802b265741a3cfbe2bf0a4ba
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/qmakelibraryinfo.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qmake/qmakelibraryinfo.cpp b/qmake/qmakelibraryinfo.cpp index 45c74c25ad..5b81106859 100644 --- a/qmake/qmakelibraryinfo.cpp +++ b/qmake/qmakelibraryinfo.cpp @@ -169,17 +169,22 @@ static QLibraryInfoPrivate::LocationInfo defaultLocationInfo(int loc) return result; } +static QString libraryInfoPath(QLibraryInfo::LibraryPath location) +{ + return QLibraryInfoPrivate::path(location, QLibraryInfoPrivate::UsedFromQtBinDir); +} + static QString storedPath(int loc) { QString result; if (loc < QMakeLibraryInfo::FirstHostPath) { - result = QLibraryInfo::path(static_cast<QLibraryInfo::LibraryPath>(loc)); + result = libraryInfoPath(static_cast<QLibraryInfo::LibraryPath>(loc)); } else if (loc <= QMakeLibraryInfo::LastHostPath) { if (loc == QMakeLibraryInfo::HostDataPath) { // Handle QT_HOST_DATADIR specially. It is not necessarily equal to QT_INSTALL_DATA. result = QT_HOST_DATADIR; } else { - result = QLibraryInfo::path(hostToTargetPathEnum(loc)); + result = libraryInfoPath(hostToTargetPathEnum(loc)); } } else if (loc == QMakeLibraryInfo::SysrootPath) { // empty result |