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()
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()
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
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@