Commit ef4ef288 authored by Tor Arne Vestbø's avatar Tor Arne Vestbø Committed by Jani Heikkinen
Browse files

Use absolute rpath to Qt libraries for non-prefix builds


Task-number: QTBUG-46391
Change-Id: Iaebba29c340fb027e23a0923f3692d47f9d450d5
Reviewed-by: default avatarMorten Johan Sørvig <morten.sorvig@theqtcompany.com>
Showing with 10 additions and 9 deletions
...@@ -40,15 +40,13 @@ qt:!isEmpty(QT_CONFIG) { ...@@ -40,15 +40,13 @@ qt:!isEmpty(QT_CONFIG) {
# libraries. This applies only to apps, since all loaded libraries inherit # libraries. This applies only to apps, since all loaded libraries inherit
# rpaths from current process executable. # rpaths from current process executable.
else:!if(host_build:force_bootstrap):equals(TEMPLATE, app):!defined(QMAKE_RPATHDIR, var):contains(QT_CONFIG, rpath) { else:!if(host_build:force_bootstrap):equals(TEMPLATE, app):!defined(QMAKE_RPATHDIR, var):contains(QT_CONFIG, rpath) {
# If app is outside of Qt SDK prefix use absolute path to Qt libraries, # If app is expected to be installed into the Qt prefix build, use
# otherwise make it relative, so all SDK tools and examples work when # relative path, so all SDK tools and examples work when relocated.
# relocated. prefix_build:defined(target.path, var):\
# Tests are an exception, since they are launched in their build not contains(target.path, "$$re_escape($$[QT_INSTALL_PREFIX])/.*"):\
# install location by CI, so we cannot use relative rpaths there. # Tests are an exception, since they are launched in their build not
if(!contains(target.path, "$$re_escape($$[QT_INSTALL_PREFIX])/.*")|\ # install location by CI, so we cannot use relative rpaths there.
contains(target.path, "$$re_escape($$[QT_INSTALL_TESTS])/.*")) { !contains(target.path, "$$re_escape($$[QT_INSTALL_TESTS])/.*") {
QMAKE_RPATHDIR = $$[QT_INSTALL_LIBS]
} else {
app_bundle { app_bundle {
ios: binpath = $$target.path/$${TARGET}.app ios: binpath = $$target.path/$${TARGET}.app
else: binpath = $$target.path/$${TARGET}.app/Contents/MacOS else: binpath = $$target.path/$${TARGET}.app/Contents/MacOS
...@@ -57,6 +55,9 @@ qt:!isEmpty(QT_CONFIG) { ...@@ -57,6 +55,9 @@ qt:!isEmpty(QT_CONFIG) {
} }
QMAKE_RPATHDIR = @loader_path/$$relative_path($$[QT_INSTALL_LIBS], $$binpath) QMAKE_RPATHDIR = @loader_path/$$relative_path($$[QT_INSTALL_LIBS], $$binpath)
unset(binpath) unset(binpath)
} else {
# Otherwise, use absolute path to Qt libraries
QMAKE_RPATHDIR = $$[QT_INSTALL_LIBS]
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment