From 47a7169e007de34d720a50f415b70006664634f6 Mon Sep 17 00:00:00 2001 From: mcpierce Date: Mon, 26 Aug 2013 20:07:22 +0000 Subject: [PATCH] PROTON-412: Fix the include and lib directories in libqpid-proton.pc If the paths aren't passed in from the command line as absolute then prepends them with CMAKE_INSTALL_PREFIX before generated the package config file. git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1517673 13f79535-47bb-0310-9956-ffa450edef68 --- proton-c/CMakeLists.txt | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt index dacc9f8..42211ba 100644 --- a/proton-c/CMakeLists.txt +++ b/proton-c/CMakeLists.txt @@ -331,11 +331,22 @@ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h DESTINATION ${INCLUDE_INSTALL_DIR}/proton) # Pkg config file -# Compatible variable names used in the pkg config files also for autoconf -get_filename_component (PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE) -get_filename_component (EXEC_PREFIX ${CMAKE_INSTALL_PREFIX} ABSOLUTE) -get_filename_component (LIBDIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR} ABSOLUTE) -get_filename_component (INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR} ABSOLUTE) +# make sure the install prefix is absolute +set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) + +macro (pn_pkgconfig_dir NAME VALUE PREFIX) + if(IS_ABSOLUTE ${VALUE}) + set(${NAME} "${VALUE}") + else(IS_ABSOLUTE ${VALUE}) + set(${NAME} "${PREFIX}/${VALUE}") + endif(IS_ABSOLUTE ${VALUE}) + get_filename_component(${NAME} ${${NAME}} ABSOLUTE) +endmacro(pn_pkgconfig_dir) + +pn_pkgconfig_dir(PREFIX ${INSTALL_PREFIX} ${INSTALL_PREFIX}) +pn_pkgconfig_dir(EXEC_PREFIX ${INSTALL_PREFIX} ${INSTALL_PREFIX}) +pn_pkgconfig_dir(LIBDIR ${LIB_INSTALL_DIR} ${INSTALL_PREFIX}) +pn_pkgconfig_dir(INCLUDEDIR ${INCLUDE_INSTALL_DIR} ${INSTALL_PREFIX}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libqpid-proton.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton.pc @ONLY) -- 1.8.3.1