Skip to content
Snippets Groups Projects
Commit f850abf4 authored by Sergei Nikulov's avatar Sergei Nikulov Committed by Daniel Stenberg
Browse files

cmake: updated OpenSSL build

parent e1cd753e
Branches
Tags
No related merge requests found
...@@ -255,20 +255,21 @@ endif() ...@@ -255,20 +255,21 @@ endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON) option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
mark_as_advanced(CMAKE_USE_OPENSSL) mark_as_advanced(CMAKE_USE_OPENSSL)
if(CMAKE_USE_OPENSSL) if(CMAKE_USE_OPENSSL)
if(WIN32)
find_package(OpenSSL) set(USE_SSLEAY OFF)
if(OPENSSL_FOUND) set(USE_OPENSSL OFF)
set(USE_SSLEAY TRUE) set(HAVE_LIBCRYPTO OFF)
set(USE_OPENSSL TRUE) set(HAVE_LIBSSL OFF)
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
else() find_package(OpenSSL)
set(CMAKE_USE_OPENSSL FALSE) if(OPENSSL_FOUND)
message(STATUS "OpenSSL NOT Found, disabling CMAKE_USE_OPENSSL") list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
endif() list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
else(WIN32) set(USE_SSLEAY ON)
check_library_exists_concat("crypto" CRYPTO_lock HAVE_LIBCRYPTO) set(USE_OPENSSL ON)
check_library_exists_concat("ssl" SSL_connect HAVE_LIBSSL) set(HAVE_LIBCRYPTO ON)
endif(WIN32) set(HAVE_LIBSSL ON)
endif(OPENSSL_FOUND)
endif(CMAKE_USE_OPENSSL) endif(CMAKE_USE_OPENSSL)
# If we have features.h, then do the _BSD_SOURCE magic # If we have features.h, then do the _BSD_SOURCE magic
...@@ -334,14 +335,17 @@ check_include_file_concat("net/if.h" HAVE_NET_IF_H) ...@@ -334,14 +335,17 @@ check_include_file_concat("net/if.h" HAVE_NET_IF_H)
check_include_file_concat("netdb.h" HAVE_NETDB_H) check_include_file_concat("netdb.h" HAVE_NETDB_H)
check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H) check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H)
check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H) check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H)
check_include_file_concat("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H) if(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
check_include_file_concat("openssl/engine.h" HAVE_OPENSSL_ENGINE_H) check_include_file_concat("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
check_include_file_concat("openssl/err.h" HAVE_OPENSSL_ERR_H) check_include_file_concat("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
check_include_file_concat("openssl/pem.h" HAVE_OPENSSL_PEM_H) check_include_file_concat("openssl/err.h" HAVE_OPENSSL_ERR_H)
check_include_file_concat("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H) check_include_file_concat("openssl/pem.h" HAVE_OPENSSL_PEM_H)
check_include_file_concat("openssl/rsa.h" HAVE_OPENSSL_RSA_H) check_include_file_concat("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
check_include_file_concat("openssl/ssl.h" HAVE_OPENSSL_SSL_H) check_include_file_concat("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
check_include_file_concat("openssl/x509.h" HAVE_OPENSSL_X509_H) check_include_file_concat("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
check_include_file_concat("openssl/x509.h" HAVE_OPENSSL_X509_H)
check_include_file_concat("openssl/rand.h" HAVE_OPENSSL_RAND_H)
endif(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
check_include_file_concat("pem.h" HAVE_PEM_H) check_include_file_concat("pem.h" HAVE_PEM_H)
check_include_file_concat("poll.h" HAVE_POLL_H) check_include_file_concat("poll.h" HAVE_POLL_H)
check_include_file_concat("pwd.h" HAVE_PWD_H) check_include_file_concat("pwd.h" HAVE_PWD_H)
...@@ -377,10 +381,6 @@ check_include_file_concat("sockio.h" HAVE_SOCKIO_H) ...@@ -377,10 +381,6 @@ check_include_file_concat("sockio.h" HAVE_SOCKIO_H)
check_include_file_concat("sys/utsname.h" HAVE_SYS_UTSNAME_H) check_include_file_concat("sys/utsname.h" HAVE_SYS_UTSNAME_H)
check_include_file_concat("idna.h" HAVE_IDNA_H) check_include_file_concat("idna.h" HAVE_IDNA_H)
if(CMAKE_USE_OPENSSL)
check_include_file_concat("openssl/rand.h" HAVE_OPENSSL_RAND_H)
endif(CMAKE_USE_OPENSSL)
if(NOT HAVE_LDAP_H) if(NOT HAVE_LDAP_H)
message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON") message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON")
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE) set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment