From: Michael Wallner Date: Thu, 9 Sep 2021 09:16:05 +0000 (+0200) Subject: fix #120: pkg-config 'Requires:' missing libsasl2 X-Git-Tag: 1.1.1~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4b7c2c7987bbac32560395e199fe3879c1fb3991;p=awesomized%2Flibmemcached fix #120: pkg-config 'Requires:' missing libsasl2 --- diff --git a/CMake/_Include.cmake b/CMake/_Include.cmake index a5a98710..22f99a8c 100644 --- a/CMake/_Include.cmake +++ b/CMake/_Include.cmake @@ -100,12 +100,21 @@ include(CheckThreads) include(CheckVisibility) include(InstallPublicHeaders) +function(pkgconfig_export VAR VAL) + get_property(PREV GLOBAL PROPERTY PKGCONFIG_${VAR}) + set_property(GLOBAL PROPERTY PKGCONFIG_${VAR} "${PREV} ${VAL}") +endfunction() +macro(pkgconfig_import VAR) + get_property(PKGCONFIG_${VAR} GLOBAL PROPERTY PKGCONFIG_${VAR}) +endmacro() + ## sasl configure_define_01(LIBMEMCACHED_WITH_SASL_SUPPORT) if(ENABLE_SASL) check_dependency(LIBSASL sasl2) if(HAVE_LIBSASL) set(LIBMEMCACHED_WITH_SASL_SUPPORT 1) + pkgconfig_export(REQUIRES libsasl2) endif() endif() diff --git a/src/libhashkit/CMakeLists.txt b/src/libhashkit/CMakeLists.txt index ed3f7f1d..b820d27b 100644 --- a/src/libhashkit/CMakeLists.txt +++ b/src/libhashkit/CMakeLists.txt @@ -46,6 +46,7 @@ if(ENABLE_OPENSSL_CRYPTO) if(OPENSSL_CRYPTO_LIBRARY) target_compile_definitions(libhashkit PRIVATE HAVE_OPENSSL_CRYPTO) target_link_libraries(libhashkit PUBLIC OpenSSL::Crypto) + pkgconfig_export(REQUIRES_PRIVATE libcrypto) else() message(WARNING "Could not find OpenSSL::Crypto") endif() diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index 306168af..16eb9c00 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -10,6 +10,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/example.cnf DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME} ) +pkgconfig_import(REQUIRES) +pkgconfig_import(REQUIRES_PRIVATE) configure_file(libmemcached.pc.in libmemcached.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmemcached.pc COMPONENT dev diff --git a/support/libmemcached.pc.in b/support/libmemcached.pc.in index ef8ce60b..f332c12e 100644 --- a/support/libmemcached.pc.in +++ b/support/libmemcached.pc.in @@ -9,3 +9,5 @@ Description: libmemcached C/C++ library Version: @PROJECT_VERSION@ Libs: -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -lmemcached -lmemcachedutil Cflags: -I@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@ +Requires: @PKGCONFIG_REQUIRES@ +Requires.private: @PKGCONFIG_REQUIRES_PRIVATE@