X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibhashkit%2FCMakeLists.txt;h=455570af3e3d78093882e303ee15a523cb441fcc;hb=f5a60f70916365f82c379339d7c5644788806a3c;hp=d0e03d15d4f3fe30de178b15669c29313b6fb99c;hpb=2aab18117a2b078dd0eb366f3766a1fef06da695;p=awesomized%2Flibmemcached diff --git a/src/libhashkit/CMakeLists.txt b/src/libhashkit/CMakeLists.txt index d0e03d15..455570af 100644 --- a/src/libhashkit/CMakeLists.txt +++ b/src/libhashkit/CMakeLists.txt @@ -17,17 +17,16 @@ set(libhashkit_sources murmur3.cc murmur3_api.cc one_at_a_time.cc - rijndael.cc str_algorithm.cc strerror.cc string.cc ) -add_library(libhashkit SHARED) +add_library(libhashkit) add_library(hashkit ALIAS libhashkit) set_target_properties(libhashkit PROPERTIES CXX_STANDARD ${CXX_STANDARD} - LIBRARY_OUTPUT_NAME hashkit - LIBRARY_OUTPUT_NAME_DEBUG hashkit-dbg + OUTPUT_NAME hashkit + OUTPUT_NAME_DEBUG hashkit-dbg SOVERSION ${LIBHASHKIT_SO_SOVERSION} VERSION ${LIBHASHKIT_SO_VERSION}) target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT) @@ -40,12 +39,21 @@ target_include_directories(libhashkit PUBLIC $ $) -find_package(OpenSSL) -if(NOT OPENSSL_FOUND) - message(WARNING "crypto library not found") -else() - add_compile_definitions(WITH_OPENSSL) - target_link_libraries(libhashkit PUBLIC OpenSSL::Crypto) +if(ENABLE_OPENSSL_CRYPTO) + find_package(OpenSSL) + if(OPENSSL_FOUND) + 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() + endif() +endif() + +if (NOT OPENSSL_CRYPTO_LIBRARY) + set (libhashkit_sources ${libhashkit_sources} rijndael.cc) endif() configure_file(hashkitcon.h.in hashkitcon.h @ONLY)