25 add_library(libhashkit SHARED)
26 add_library(hashkit ALIAS libhashkit)
27 set_target_properties(libhashkit PROPERTIES
28 CXX_STANDARD ${CXX_STANDARD}
29 LIBRARY_OUTPUT_NAME hashkit
30 LIBRARY_OUTPUT_NAME_DEBUG hashkit-dbg
31 SOVERSION ${LIBHASHKIT_SO_SOVERSION}
32 VERSION ${LIBHASHKIT_SO_VERSION})
33 target_compile_options(libhashkit PRIVATE -DBUILDING_HASHKIT)
34 target_include_directories(libhashkit PRIVATE
35 ${CMAKE_SOURCE_DIR}/src
36 ${CMAKE_BINARY_DIR}/src
38 target_include_directories(libhashkit PUBLIC
39 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
40 $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
41 $<INSTALL_INTERFACE:include>)
43 if(ENABLE_OPENSSL_CRYPTO)
46 if(OPENSSL_CRYPTO_LIBRARY)
47 target_compile_definitions(libhashkit PRIVATE HAVE_OPENSSL_CRYPTO)
48 target_link_libraries(libhashkit PUBLIC OpenSSL::Crypto)
49 pkgconfig_export(REQUIRES_PRIVATE libcrypto)
51 message(WARNING "Could not find OpenSSL::Crypto")
56 configure_file(hashkitcon.h.in hashkitcon.h @ONLY)
58 install(TARGETS libhashkit EXPORT libhashkit-targets
59 RUNTIME COMPONENT bin DESTINATION ${CMAKE_INSTALL_BINDIR}
60 ARCHIVE COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
61 LIBRARY COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
62 ${TARGET_NAMELINK_COMPONENT}
64 export(EXPORT libhashkit-targets NAMESPACE libmemcached::)
65 install(EXPORT libhashkit-targets NAMESPACE libmemcached::
67 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
69 install_public_headers(
75 target_sources(libhashkit PRIVATE
77 ${libhashkit_includes})