summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-08-09 15:02:44 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-11 10:40:23 +0200
commitb603fd36c256e91beff758363d6943cf2f8294d8 (patch)
treee630ac04db6f4c8dea98ef85edf3b629ee73e3dc /mkspecs
parent43af0260b8956a04652e7dd1e39814d220413573 (diff)
support -rpath for modules which are not installed to QT_INSTALL_PREFIX
a module's project file may set MODULE_INSTALL_LIBS before loading qt_module.prf to have an alternative RPATH linked into the users of that module. this is relevant only for linking against non-installed -prefix builds of that module, as otherwise .libs from the module's pri file is used for rpath. Change-Id: Ib240e748cf130a71a5991dc643c368a983092ead Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/qt_functions.prf7
-rw-r--r--mkspecs/features/qt_module_fwdpri.prf3
2 files changed, 10 insertions, 0 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 8daa2c4bbe..a8f4d34268 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -94,6 +94,12 @@ defineTest(qtAddModule) {
isEmpty(lib): lib = -l$${MODULE_NAME}$${QT_LIBINFIX}
LINKAGE += $$lib
+ contains(QT_CONFIG, rpath) {
+ rpath = $$eval(QT.$${MODULE}.rpath)
+ isEmpty(rpath): rpath = $$MODULE_LIBS
+ QMAKE_RPATHDIR *= $$rpath
+ }
+
# Make sure we can link to uninstalled libraries
unix:!mac:!isEmpty(QT.$${1}.libs) { # Use unmodified path, so /usr/lib also works
for(rpl, QT.$${1}.rpath_link): \
@@ -120,6 +126,7 @@ defineTest(qtAddModule) {
export(QMAKE_FRAMEWORKPATH)
export(QMAKE_LFLAGS)
export(QMAKE_LIBDIR)
+ export(QMAKE_RPATHDIR)
return(true)
}
diff --git a/mkspecs/features/qt_module_fwdpri.prf b/mkspecs/features/qt_module_fwdpri.prf
index 0f7c7c4726..04d2d7771f 100644
--- a/mkspecs/features/qt_module_fwdpri.prf
+++ b/mkspecs/features/qt_module_fwdpri.prf
@@ -11,6 +11,8 @@
# Permit modules to enforce being built outside QTDIR.
force_independent: mod_component_base = $$MODULE_BASE_OUTDIR
+ isEmpty(MODULE_INSTALL_LIBS): MODULE_INSTALL_LIBS = $$[QT_INSTALL_LIBS]
+
MODULE_FWD_PRI = $$mod_qmake_base/mkspecs/modules/qt_$${MODULE}.pri
# -rpath-link is used by the linker to find depedencies of dynamic
@@ -64,6 +66,7 @@
"QT_MODULE_PLUGIN_BASE = $$mod_component_base/plugins" \
$$module_rpathlink \
$$module_rpathlink_priv \
+ "QT.$${MODULE}.rpath = $$MODULE_INSTALL_LIBS" \
"include($$MODULE_PRI)"
write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
touch($$MODULE_FWD_PRI, $$MODULE_PRI)