From 90b4f410a07222fa2e9a5f53b454a09d4533e45a Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:50:37 +0100 Subject: [PATCH] cmake: Refer to `prefix` variable in generated `libzmq.pc` This change: 1. Makes the `libzmq.pc` files generated by Autotools and CMake more aligned. 2. Allows the `prefix` variable to be redefined if the package is relocated. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ad2cc10..861164ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1256,9 +1256,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/platform.hpp.in ${CMAKE_ list(APPEND sources ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp) set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix ${prefix}) -set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR}) -set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) +set(exec_prefix "\${prefix}") +set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") +set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") set(VERSION ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libzmq.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc @ONLY) set(zmq-pkgconfig ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc)