diff OrthancFramework/Resources/CMake/OpenSslConfiguration.cmake @ 4526:59b667dd58a8

fix cross-compilation for big endian on Debian 10
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 23 Feb 2021 20:05:26 +0100
parents d9473bd5ed43
children 312e0e29de90 7053502fbf97
line wrap: on
line diff
--- a/OrthancFramework/Resources/CMake/OpenSslConfiguration.cmake	Tue Feb 23 15:19:40 2021 +0100
+++ b/OrthancFramework/Resources/CMake/OpenSslConfiguration.cmake	Tue Feb 23 20:05:26 2021 +0100
@@ -41,10 +41,15 @@
   if (NOT HAVE_OPENSSL_CRYPTO_LIB)
     message(FATAL_ERROR "Please install the libopenssl package")
   endif()  
-  
+
+  # The "SSL_library_init" is for OpenSSL <= 1.0.2, whereas
+  # "OPENSSL_init_ssl" is for OpenSSL >= 1.1.0
   CHECK_LIBRARY_EXISTS(ssl "SSL_library_init" "" HAVE_OPENSSL_SSL_LIB)
   if (NOT HAVE_OPENSSL_SSL_LIB)
-    message(FATAL_ERROR "Please install the libopenssl package")
+    CHECK_LIBRARY_EXISTS(ssl "OPENSSL_init_ssl" "" HAVE_OPENSSL_SSL_LIB_2)
+    if (NOT HAVE_OPENSSL_SSL_LIB_2)
+      message(FATAL_ERROR "Please install the libopenssl package")
+    endif()  
   endif()  
   
   link_libraries(crypto ssl)