mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
cmake: fixed when OpenSSL enabled on Windows and schannel detected
Closes #617
This commit is contained in:
parent
91460b2b8a
commit
a8135f0768
@ -122,11 +122,6 @@ endif()
|
|||||||
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
|
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
|
||||||
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
|
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
|
||||||
|
|
||||||
IF(WIN32)
|
|
||||||
OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
|
|
||||||
MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
|
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
|
||||||
mark_as_advanced(HTTP_ONLY)
|
mark_as_advanced(HTTP_ONLY)
|
||||||
option(CURL_DISABLE_FTP "disables FTP" OFF)
|
option(CURL_DISABLE_FTP "disables FTP" OFF)
|
||||||
@ -253,6 +248,7 @@ include (CheckLibraryExists)
|
|||||||
include (CheckSymbolExists)
|
include (CheckSymbolExists)
|
||||||
include (CheckTypeSize)
|
include (CheckTypeSize)
|
||||||
include (CheckCSourceCompiles)
|
include (CheckCSourceCompiles)
|
||||||
|
include (CMakeDependentOption)
|
||||||
|
|
||||||
# On windows preload settings
|
# On windows preload settings
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@ -290,14 +286,22 @@ endif(NOT NOT_NEED_LIBNSL)
|
|||||||
|
|
||||||
check_function_exists(gethostname HAVE_GETHOSTNAME)
|
check_function_exists(gethostname HAVE_GETHOSTNAME)
|
||||||
|
|
||||||
|
set(OPENSSL_DEFAULT ON)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
set(OPENSSL_DEFAULT OFF)
|
||||||
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
|
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
|
||||||
check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
|
check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
|
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${OPENSSL_DEFAULT})
|
||||||
mark_as_advanced(CMAKE_USE_OPENSSL)
|
mark_as_advanced(CMAKE_USE_OPENSSL)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
CMAKE_DEPENDENT_OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON
|
||||||
|
"NOT CMAKE_USE_OPENSSL" OFF)
|
||||||
|
mark_as_advanced(CURL_WINDOWS_SSPI)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(USE_OPENSSL OFF)
|
set(USE_OPENSSL OFF)
|
||||||
set(HAVE_LIBCRYPTO OFF)
|
set(HAVE_LIBCRYPTO OFF)
|
||||||
set(HAVE_LIBSSL OFF)
|
set(HAVE_LIBSSL OFF)
|
||||||
@ -320,6 +324,8 @@ if(CMAKE_USE_OPENSSL)
|
|||||||
check_include_file("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
check_include_file("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
||||||
check_include_file("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
check_include_file("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
||||||
check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
||||||
|
elseif(WIN32)
|
||||||
|
set(CURL_WINDOWS_SSPI ON)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -1055,7 +1061,8 @@ endfunction()
|
|||||||
|
|
||||||
# Clear list and try to detect available features
|
# Clear list and try to detect available features
|
||||||
set(_items)
|
set(_items)
|
||||||
_add_if("SSL" SSL_ENABLED)
|
_add_if("WinSSL" SSL_ENABLED AND USE_WINDOWS_SSPI)
|
||||||
|
_add_if("OpenSSL" SSL_ENABLED AND USE_OPENSSL)
|
||||||
_add_if("IPv6" ENABLE_IPV6)
|
_add_if("IPv6" ENABLE_IPV6)
|
||||||
_add_if("unix-sockets" USE_UNIX_SOCKETS)
|
_add_if("unix-sockets" USE_UNIX_SOCKETS)
|
||||||
_add_if("libz" HAVE_LIBZ)
|
_add_if("libz" HAVE_LIBZ)
|
||||||
|
Loading…
Reference in New Issue
Block a user