-add_library(libhashkit SHARED
+set(libhashkit_sources
aes.cc
algorithm.cc
common.h
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(hashkit ALIAS libhashkit)
set_target_properties(libhashkit PROPERTIES
CXX_STANDARD ${CXX_STANDARD}
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
+
+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
hashkit.h
)
+
+target_sources(libhashkit PRIVATE
+ ${libhashkit_sources}
+ ${libhashkit_includes})