aboutsummaryrefslogtreecommitdiff
path: root/modules/ECMGeneratePkgConfigFile.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2019-03-04 12:52:13 +0100
committerDavid Faure <faure@kde.org>2019-03-04 13:35:46 +0100
commitabe529e7017e841f64bb231ea31a73094fe7adbd (patch)
tree5afa47e009ec3c871e4ba91e69eee42c7d855521 /modules/ECMGeneratePkgConfigFile.cmake
parent514835418c9d8c16eacac8cad5e522a896d4db7b (diff)
downloadextra-cmake-modules-abe529e7017e841f64bb231ea31a73094fe7adbd.tar.gz
extra-cmake-modules-abe529e7017e841f64bb231ea31a73094fe7adbd.tar.bz2
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
Diffstat (limited to 'modules/ECMGeneratePkgConfigFile.cmake')
-rw-r--r--modules/ECMGeneratePkgConfigFile.cmake11
1 files changed, 8 insertions, 3 deletions
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}
"
)