Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / src / libhashkit / CMakeLists.txt
index ed3f7f1d77caf79d7db960a07239ba735b7badf2..455570af3e3d78093882e303ee15a523cb441fcc 100644 (file)
@@ -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)
@@ -46,12 +45,17 @@ if(ENABLE_OPENSSL_CRYPTO)
                 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