24 add_library(libhashkit SHARED)
25 add_library(hashkit ALIAS libhashkit)
26 set_target_properties(libhashkit PROPERTIES
27 CXX_STANDARD ${CXX_STANDARD}
28 LIBRARY_OUTPUT_NAME hashkit
29 LIBRARY_OUTPUT_NAME_DEBUG hashkit-dbg
30 SOVERSION ${LIBHASHKIT_SO_SOVERSION}
31 VERSION ${LIBHASHKIT_SO_VERSION})
32 target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT)
33 target_include_directories(libhashkit PRIVATE
34 ${CMAKE_SOURCE_DIR}/src
35 ${CMAKE_BINARY_DIR}/src
37 target_include_directories(libhashkit PUBLIC
38 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
39 $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
40 $<INSTALL_INTERFACE:include>)
42 if(ENABLE_OPENSSL_CRYPTO)
45 if(OPENSSL_CRYPTO_LIBRARY)
46 target_compile_definitions(libhashkit PRIVATE HAVE_OPENSSL_CRYPTO)
47 target_link_libraries(libhashkit PUBLIC OpenSSL::Crypto)
48 pkgconfig_export(REQUIRES_PRIVATE libcrypto)
50 message(WARNING "Could not find OpenSSL::Crypto")
55 if (NOT OPENSSL_CRYPTO_LIBRARY)
56 set (libhashkit_sources ${libhashkit_sources} rijndael.cc)
59 configure_file(hashkitcon.h.in hashkitcon.h @ONLY)
61 install(TARGETS libhashkit EXPORT libhashkit-targets
62 RUNTIME COMPONENT bin DESTINATION ${CMAKE_INSTALL_BINDIR}
63 ARCHIVE COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
64 LIBRARY COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
65 ${TARGET_NAMELINK_COMPONENT}
67 export(EXPORT libhashkit-targets NAMESPACE libmemcached::)
68 install(EXPORT libhashkit-targets NAMESPACE libmemcached::
70 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
72 install_public_headers(
78 target_sources(libhashkit PRIVATE
80 ${libhashkit_includes})