From 89f0dde7ff89fa3e4fc2dd73ef89bcea44f1fdfc Mon Sep 17 00:00:00 2001 From: Ameya Vikram Singh Date: Sun, 29 Oct 2017 23:57:25 +0530 Subject: [PATCH] Fix generated `pkg-config` file using cmake. Fixed the generated `jansson.pc` with cmake to be consistent with the one generated using GNU Autotools. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 418d8b3..cd0ad7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -599,8 +599,9 @@ set(JANSSON_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation # (We use the same files as ./configure does, so we # have to defined the same variables used there). set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix ${CMAKE_INSTALL_PREFIX}) -set(libdir ${CMAKE_INSTALL_PREFIX}/${JANSSON_INSTALL_LIB_DIR}) +set(exec_prefix "\${prefix}") +set(libdir "\${exec_prefix}/${JANSSON_INSTALL_LIB_DIR}") +set(includedir "\${prefix}/${JANSSON_INSTALL_INCLUDE_DIR}") set(VERSION ${JANSSON_DISPLAY_VERSION}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jansson.pc.in ${CMAKE_CURRENT_BINARY_DIR}/jansson.pc @ONLY)