X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibhashkit%2FCMakeLists.txt;h=455570af3e3d78093882e303ee15a523cb441fcc;hb=ae093bfbe9693e50a368e29048d83c2f8f8422e7;hp=355afabbb78239a68c4f38c372a4598f973f7ec4;hpb=ead804ac3d641c842d6b24c1de7e1c235fee2448;p=awesomized%2Flibmemcached diff --git a/src/libhashkit/CMakeLists.txt b/src/libhashkit/CMakeLists.txt index 355afabb..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) @@ -39,6 +38,24 @@ target_include_directories(libhashkit PUBLIC $ $ $) + +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) install(TARGETS libhashkit EXPORT libhashkit-targets