From abe529e7017e841f64bb231ea31a73094fe7adbd Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 4 Mar 2019 12:52:13 +0100 Subject: ECMGeneratePkgConfigFile: add variables used by pkg_check_modules Summary: If we ever end up in a situation where the generated .pc file is actually used by cmake's pkg_check_modules, then we need the includedir and libdir variables; pkg_check_modules ignores the Makefile-like Libs and Cflags lines of the .pc file. Context: craft adds a cmake buildsystem for sqlite3, which is then found using pkgconfig in akonadi. Test Plan: Filipe Azevedo is doing all the testing, I'm just providing patches :) Reviewers: apol, fazevedo, cgiboudeaux Reviewed By: fazevedo, cgiboudeaux Subscribers: cgiboudeaux, fazevedo, kde-buildsystem, kde-frameworks-devel Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D19506 --- modules/ECMGeneratePkgConfigFile.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'modules/ECMGeneratePkgConfigFile.cmake') diff --git a/modules/ECMGeneratePkgConfigFile.cmake b/modules/ECMGeneratePkgConfigFile.cmake index 76572167..51c21198 100644 --- a/modules/ECMGeneratePkgConfigFile.cmake +++ b/modules/ECMGeneratePkgConfigFile.cmake @@ -156,9 +156,9 @@ function(ECM_GENERATE_PKGCONFIG_FILE) string(REPLACE ";" " " PKGCONFIG_TARGET_DEPS "${EGPF_DEPS}") endif () if(IS_ABSOLUTE "${EGPF_INCLUDE_INSTALL_DIR}") - set(PKGCONFIG_TARGET_INCLUDES "-I${EGPF_INCLUDE_INSTALL_DIR}") + set(PKGCONFIG_TARGET_INCLUDES "${EGPF_INCLUDE_INSTALL_DIR}") else() - set(PKGCONFIG_TARGET_INCLUDES "-I${CMAKE_INSTALL_PREFIX}/${EGPF_INCLUDE_INSTALL_DIR}") + set(PKGCONFIG_TARGET_INCLUDES "${CMAKE_INSTALL_PREFIX}/${EGPF_INCLUDE_INSTALL_DIR}") endif() if(IS_ABSOLUTE "${EGPF_LIB_INSTALL_DIR}") set(PKGCONFIG_TARGET_LIBS "${EGPF_LIB_INSTALL_DIR}") @@ -178,11 +178,16 @@ function(ECM_GENERATE_PKGCONFIG_FILE) file(WRITE ${PKGCONFIG_FILENAME} " +prefix=${CMAKE_INSTALL_PREFIX} +exec_prefix=${CMAKE_INSTALL_PREFIX} +libdir=${CMAKE_INSTALL_PREFIX}/${EGPF_LIB_INSTALL_DIR} +includedir=${PKGCONFIG_TARGET_INCLUDES} + Name: ${PKGCONFIG_TARGET_LIBNAME} Description: ${PKGCONFIG_TARGET_DESCRIPTION} Version: ${PROJECT_VERSION} Libs: -L${CMAKE_INSTALL_PREFIX}/${EGPF_LIB_INSTALL_DIR} -l${PKGCONFIG_TARGET_LIBNAME} -Cflags: ${PKGCONFIG_TARGET_INCLUDES} ${PKGCONFIG_TARGET_DEFINES} +Cflags: -I${PKGCONFIG_TARGET_INCLUDES} ${PKGCONFIG_TARGET_DEFINES} Requires: ${PKGCONFIG_TARGET_DEPS} " ) -- cgit v1.2.1