summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--automotive-dlt.pc.in2
2 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57044d6..ff53ceb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -209,6 +209,12 @@ else()
set(PACKAGE_DOC "")
endif()
+if (BUILD_SHARED_LIBS)
+ set(CMAKE_STATIC_LIB_PATH "")
+else()
+ set(CMAKE_STATIC_LIB_PATH "-L\$\{libdir\}/static")
+endif()
+
if(WITH_DLT_PKGCONFIG)
configure_file(${PROJECT_SOURCE_DIR}/${PROJECT_NAME}.spec.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.spec)
configure_file(${PROJECT_SOURCE_DIR}/${PROJECT_NAME}.pc.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY)
diff --git a/automotive-dlt.pc.in b/automotive-dlt.pc.in
index 568b102..ddca060 100644
--- a/automotive-dlt.pc.in
+++ b/automotive-dlt.pc.in
@@ -22,6 +22,6 @@ Name: DLT
Description: Diagnostic Log and Trace
Version: @PROJECT_VERSION@
Requires:
-Libs: -L${libdir} -L${libdir}/static -ldlt -lrt -lpthread @ZLIB_LIBRARY@
+Libs: -L${libdir} @CMAKE_STATIC_LIB_PATH@ -ldlt -lrt -lpthread @ZLIB_LIBRARY@
Cflags: -I${includedir}/dlt -I${includedir} -DDLT_@PROJECT_VERSION_MAJOR@_@PROJECT_VERSION_MINOR@