From c414786c27a20f4d55471aacc7ac7a985a71b230 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 1 Mar 2013 12:25:20 +0100 Subject: [PATCH] Fixed dependencies and generation of .pc file (issue #28). --- CMakeLists.txt | 14 +++++++++----- libvmime.pc.in | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0b7578f..42c1539a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,9 +300,6 @@ IF(${WIN32}) SET(libdir ${CMAKE_INSTALL_PREFIX}/bin) ENDIF(${WIN32}) -CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libvmime.pc.in ${CMAKE_BINARY_DIR}/libvmime.pc @ONLY) -INSTALL(FILES ${CMAKE_BINARY_DIR}/libvmime.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT headers) - ############################################################################## # Build type @@ -540,7 +537,7 @@ IF(VMIME_HAVE_TLS_SUPPORT) SET(VMIME_PKGCONFIG_LIBS "${VMIME_PKGCONFIG_LIBS} ${GNUTLS_LIBRARY_DIRS} ${GNUTLS_LIBRARY}") SET(VMIME_PKGCONFIG_CFLAGS "${VMIME_PKGCONFIG_CFLAGS} ${GNUTLS_INCLUDE_DIR}") - SET(VMIME_PKGCONFIG_REQUIRES "${VMIME_PKGCONFIG_REQUIRES} libgnutls") + SET(VMIME_PKGCONFIG_REQUIRES "${VMIME_PKGCONFIG_REQUIRES} gnutls") ELSEIF(VMIME_TLS_SUPPORT_LIB_IS_OPENSSL) @@ -559,7 +556,7 @@ IF(VMIME_HAVE_TLS_SUPPORT) SET(VMIME_PKGCONFIG_LIBS "${VMIME_PKGCONFIG_LIBS} ${OPENSSL_LIBRARIES}") SET(VMIME_PKGCONFIG_CFLAGS "${VMIME_PKGCONFIG_CFLAGS} ${OPENSSL_INCLUDE_DIR}") - SET(VMIME_PKGCONFIG_REQUIRES "${VMIME_PKGCONFIG_REQUIRES} libopenssl") + SET(VMIME_PKGCONFIG_REQUIRES "${VMIME_PKGCONFIG_REQUIRES} openssl") ELSE() @@ -588,6 +585,9 @@ IF(VMIME_BUILD_SHARED_LIBRARY) ) ENDIF() +SET(VMIME_PKGCONFIG_LIBS "${VMIME_PKGCONFIG_LIBS} ${ICONV_LIBRARIES}") +SET(VMIME_PKGCONFIG_CFLAGS "${VMIME_PKGCONFIG_CFLAGS} ${ICONV_INCLUDE_DIR}") + ############################################################################## # Platform @@ -767,5 +767,9 @@ ENDIF() # Set our configure file CONFIGURE_FILE(cmake/config.hpp.cmake vmime/config.hpp) +# PkgConfig post-configuration +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/libvmime.pc.in ${CMAKE_BINARY_DIR}/libvmime.pc @ONLY) +INSTALL(FILES ${CMAKE_BINARY_DIR}/libvmime.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig COMPONENT headers) + INCLUDE(CPack) diff --git a/libvmime.pc.in b/libvmime.pc.in index 5745c52f..ce924a8d 100644 --- a/libvmime.pc.in +++ b/libvmime.pc.in @@ -3,10 +3,10 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: @VMIME_LIBRARY_NAME@ +Name: @VMIME_PACKAGE_NAME@ Description: @VMIME_PACKAGE_DESCRIPTION@ Version: @VMIME_PACKAGE_VERSION@ -Requires: @VMIME_PKGCONFIG_REQUIRES@ -Libs: -L${libdir} -lvmime @VMIME_PKGCONFIG_LIBS@ +Requires.private: @VMIME_PKGCONFIG_REQUIRES@ +Libs.private: -L${libdir} -l@VMIME_LIBRARY_NAME@ @VMIME_PKGCONFIG_LIBS@ Cflags: -I${includedir}/ @VMIME_PKGCONFIG_CFLAGS@