From 9887fa23332d46b3924638a91a264a902f54e518 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Sat, 13 Sep 2014 18:15:45 -0400 Subject: [PATCH] rpath improvements Improve on the previous commit adding QMAKE_RPATHDIR. We can now use rpath for out-of-source builds, as well as on osx. --- .travis.yml | 1 - src/src.pro | 1 + tests/tests.pri | 6 +++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cdddb8b..1704c5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,4 @@ script: - cd build - qmake .. - make - - export LD_LIBRARY_PATH=$PWD/src - make check \ No newline at end of file diff --git a/src/src.pro b/src/src.pro index e176268..07e73dd 100644 --- a/src/src.pro +++ b/src/src.pro @@ -9,6 +9,7 @@ DEFINES += QAMQP_BUILD CONFIG += $${QAMQP_LIBRARY_TYPE} VERSION = $${QAMQP_VERSION} win32:DESTDIR = $$OUT_PWD +macx:QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/ PRIVATE_HEADERS += \ qamqpchannel_p.h \ diff --git a/tests/tests.pri b/tests/tests.pri index afbad40..c3125ed 100644 --- a/tests/tests.pri +++ b/tests/tests.pri @@ -1,7 +1,11 @@ INCLUDEPATH += $${QAMQP_INCLUDEPATH} $${PWD}/common LIBS += -L$${DEPTH}/src $${QAMQP_LIBS} -QMAKE_RPATHDIR += $${DEPTH}/src +unix:!macx:QMAKE_RPATHDIR += $${OUT_PWD}/$${DEPTH}/src +macx { + QMAKE_RPATHDIR += @loader_path/$${DEPTH}/src + QMAKE_LFLAGS += -Wl,-rpath,@loader_path/$${DEPTH}/src +} QT = core network testlib QT -= gui