From fa89c5b866292275da00ff6a54030043688f3511 Mon Sep 17 00:00:00 2001 From: Egor Poleshko Date: Wed, 27 Apr 2022 23:56:21 +0300 Subject: [PATCH 1/3] Problem: CMake not installing libzmqpp.pc to PREFIX Solution: Modify src/libzmqpp.pc to have dynamic prefix path, update CMake to configure src/libzmqpp.pc and install it to CMAKE_INSTALL_PREFIX/lib/pkgconfig --- CMakeLists.txt | 7 +++++++ src/libzmqpp.pc | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e2cc7ae..f4867567 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,6 +231,9 @@ if( ZMQPP_BUILD_TESTS ) add_test( zmqpp-test zmqpp-test-runner --log-level=test-suite ) endif() +# Configure pkg-config file +# ------------------------- +configure_file(src/libzmqpp.pc ${CMAKE_BINARY_DIR}/libzmqpp.pc) # Install # ------- @@ -245,3 +248,7 @@ install(DIRECTORY src/zmqpp DESTINATION include/ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmqpp_export.h" DESTINATION "include") + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/libzmqpp.pc" + DESTINATION "lib/pkgconfig") \ No newline at end of file diff --git a/src/libzmqpp.pc b/src/libzmqpp.pc index fd9c60f7..18142584 100644 --- a/src/libzmqpp.pc +++ b/src/libzmqpp.pc @@ -1,4 +1,4 @@ -prefix=/usr/local +prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} libdir=${prefix}/lib includedir=${prefix}/include From 550f4f9f6ea5abb92194a5e921de0f15a97909c1 Mon Sep 17 00:00:00 2001 From: Egor Poleshko Date: Wed, 27 Apr 2022 23:56:33 +0300 Subject: [PATCH 2/3] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index b696e235..a2a48014 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,6 +3,7 @@ Individual Contributors Author: Ben Gray Author: Dmitry Odzerikho +Author: Egor Poleshko Author: Michi Henning Author: Pieter Hintjens Author: Rob Hubbard From e7204a45ffe35c20c47d48100a8956113085b5e2 Mon Sep 17 00:00:00 2001 From: Egor Poleshko Date: Thu, 28 Apr 2022 00:32:53 +0300 Subject: [PATCH 3/3] Problem: libzmqpp.pc having empty or too few fields Solution: Replace to @variable_name@ --- src/libzmqpp.pc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libzmqpp.pc b/src/libzmqpp.pc index 18142584..80f5fac5 100644 --- a/src/libzmqpp.pc +++ b/src/libzmqpp.pc @@ -1,7 +1,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_PREFIX@/lib +includedir=@CMAKE_INSTALL_PREFIX@/include Name: libzmqpp Description: The high-level C++ binding for 0MQ @@ -9,5 +9,5 @@ Version: Requires: libzmq -Libs: -L${libdir} -lzmqpp -Cflags: -I${includedir} +Libs: -L@CMAKE_INSTALL_PREFIX@/lib -lzmqpp +Cflags: -I@CMAKE_INSTALL_PREFIX@/include