Skip to content

Commit

Permalink
fix awesomized#120: pkg-config 'Requires:' missing libsasl2
Browse files Browse the repository at this point in the history
  • Loading branch information
m6w6 committed Sep 9, 2021
1 parent fd5ff11 commit 4b7c2c7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMake/_Include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions src/libhashkit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions support/libmemcached.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@

0 comments on commit 4b7c2c7

Please sign in to comment.