aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2016-11-24 17:53:02 +0100
committerDominik Holland <dominik.holland@pelagicore.com>2016-11-29 12:46:49 +0000
commita293579f7cfeb5ced5d247e79159becc0f546ec0 (patch)
treed108be2c907e7cf8070ccd6a41b309bfc5e8e4ef
parent6cd72e69344538a3c91842128b8b062aef9775d8 (diff)
Fixed problems when resolving the libdlt dependency
The automotive-dlt pkg-config files points to the include folder of dlt so we don't need the dlt prefix when including the headers. As dlt is installed into /usr, this wasn't a problem as it still worked. But if dlt is build manually it installs itself to /usr/local and the paths are not correct in this case. When picking up libdlt we also need to make sure that the path we resolved using pkg-config is added as a rpath and this is part of the prl file created for QtGeniviExtras, as the custom rpath is also needed for the application/lib using QtGeniviExtras, as it would have a unresolved runtime dependency otherwise Change-Id: I3f2a78482573e6802371e29392de5a4a49b5c379 Reviewed-by: Johan Thelin <johan.thelin@pelagicore.com> Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
-rw-r--r--config.tests/dlt/main.cpp2
-rw-r--r--src/geniviextras/geniviextras.pro4
-rw-r--r--src/geniviextras/qdltregistration_p.h2
-rw-r--r--tests/auto/dlt/dlt.pro2
4 files changed, 8 insertions, 2 deletions
diff --git a/config.tests/dlt/main.cpp b/config.tests/dlt/main.cpp
index f85bf95..5c97048 100644
--- a/config.tests/dlt/main.cpp
+++ b/config.tests/dlt/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <dlt/dlt.h>
+#include <dlt.h>
int main()
{
diff --git a/src/geniviextras/geniviextras.pro b/src/geniviextras/geniviextras.pro
index fb35108..573221c 100644
--- a/src/geniviextras/geniviextras.pro
+++ b/src/geniviextras/geniviextras.pro
@@ -10,10 +10,14 @@ OTHER_FILES += \
$$PWD/doc/*.qdocconf \
$$PWD/doc/src/*.qdoc
+DLT_LIB_PATH = $$system($$pkgConfigExecutable() --variable=libdir automotive-dlt)
system($$pkgConfigExecutable() --libs \"automotive-dlt >= 2.12.0\"): DEFINES += DLT_VERSION_2_12
!contains(QT_CONFIG, no-pkg-config) {
PKGCONFIG += automotive-dlt
+
+ #Make sure that the rpath is also added when linking against the lib and is part of the prl
+ LIBS += -Wl,-rpath=$$DLT_LIB_PATH
} else {
LIBS += -ldlt
}
diff --git a/src/geniviextras/qdltregistration_p.h b/src/geniviextras/qdltregistration_p.h
index 495b741..2aac6b5 100644
--- a/src/geniviextras/qdltregistration_p.h
+++ b/src/geniviextras/qdltregistration_p.h
@@ -42,7 +42,7 @@
#include <QString>
#include <QHash>
-#include <dlt/dlt.h>
+#include <dlt.h>
//
// W A R N I N G
diff --git a/tests/auto/dlt/dlt.pro b/tests/auto/dlt/dlt.pro
index bbc2de0..feb04bc 100644
--- a/tests/auto/dlt/dlt.pro
+++ b/tests/auto/dlt/dlt.pro
@@ -3,8 +3,10 @@ QT += testlib geniviextras
TARGET = tst_dlt
CONFIG += testcase link_pkgconfig
+DLT_LIB_PATH = $$system($$pkgConfigExecutable() --variable=libdir automotive-dlt)
!contains(QT_CONFIG, no-pkg-config) {
PKGCONFIG += automotive-dlt
+ QMAKE_RPATH += $$DLT_LIB_PATH
} else {
LIBS += -ldlt
}