diff options
author | Brad King <brad.king@kitware.com> | 2012-09-11 15:01:57 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-09-11 15:01:57 -0400 |
commit | 1d3db6b34df827566ffe5615d568de0ef64d3e61 (patch) | |
tree | 56eea24589eb1aad1af001fef26714762d088249 /Utilities | |
parent | ba72828eddae12bb07eb8e0098de04b5cd4284fa (diff) | |
parent | 8b51762426ff6e3efbe61ee49f99755c24b4772c (diff) | |
download | cmake-1d3db6b34df827566ffe5615d568de0ef64d3e61.tar.gz |
Merge topic 'curl-openssl'
8b51762 curl: Honor OPENSSL_NO_SSL2
bc0e8c2 curl: Make OpenSSL DLLs available to CMake on Windows
c2f4759 curl: Use find_package(OpenSSL)
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/cmcurl/CMakeLists.txt | 42 | ||||
-rw-r--r-- | Utilities/cmcurl/config.h.in | 3 | ||||
-rw-r--r-- | Utilities/cmcurl/curl/curl.h | 2 | ||||
-rw-r--r-- | Utilities/cmcurl/ssluse.c | 5 | ||||
-rw-r--r-- | Utilities/cmcurl/strerror.c | 5 |
5 files changed, 38 insertions, 19 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index caa44f1d6b..ef000a16a6 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -169,27 +169,42 @@ IF(NOT CURL_SPECIAL_LIBZ) CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ) ENDIF(NOT CURL_SPECIAL_LIBZ) -OPTION(CMAKE_USE_OPENSSL "Use OpenSSL code." OFF) +OPTION(CMAKE_USE_OPENSSL "Use OpenSSL code with curl." OFF) MARK_AS_ADVANCED(CMAKE_USE_OPENSSL) IF(CMAKE_USE_OPENSSL) SET(USE_SSLEAY TRUE) SET(USE_OPENSSL TRUE) - IF(WIN32) - FIND_PATH(SSLINCLUDE openssl/crypto.h - PATHS c:/hoffman/Tools/openssl_w32vc6-0.9.8g/inc32) - INCLUDE_DIRECTORIES(${SSLINCLUDE}) - FIND_LIBRARY(LIBEAY NAMES libeay32) - FIND_LIBRARY(SSLEAY NAMES ssleay32) - SET(CURL_LIBS ${CURL_LIBS} ${LIBEAY} ${SSLEAY} ) - ELSE(WIN32) - CHECK_LIBRARY_EXISTS_CONCAT("crypto" CRYPTO_lock HAVE_LIBCRYPTO) - CHECK_LIBRARY_EXISTS_CONCAT("ssl" SSL_connect HAVE_LIBSSL) - ENDIF(WIN32) + FIND_PACKAGE(OpenSSL REQUIRED) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + SET(CURL_LIBS ${CURL_LIBS} ${OPENSSL_LIBRARIES}) SET(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") MARK_AS_ADVANCED(CURL_CA_BUNDLE) IF(CURL_CA_BUNDLE) ADD_DEFINITIONS(-DCURL_CA_BUNDLE="${CURL_CA_BUNDLE}") ENDIF(CURL_CA_BUNDLE) + # for windows we want to install OPENSSL_LIBRARIES dlls + # and also copy them into the build tree so that testing + # can find them. + IF(WIN32) + FIND_FILE(CMAKE_EAY_DLL NAME libeay32.dll HINTS ${OPENSSL_INCLUDE_DIR}/..) + FIND_FILE(CMAKE_SSL_DLL NAME ssleay32.dll HINTS ${OPENSSL_INCLUDE_DIR}/..) + MARK_AS_ADVANCED(CMAKE_EAY_DLL CMAKE_SSL_DLL) + IF(CMAKE_SSL_DLL AND CMAKE_EAY_DLL) + SET(CMAKE_CURL_SSL_DLLS ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/libeay32.dll + ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/ssleay32.dll) + ADD_CUSTOM_COMMAND(OUTPUT + ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/libeay32.dll + DEPENDS ${CMAKE_EAY_DLL} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_EAY_DLL} + ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/libeay32.dll) + ADD_CUSTOM_COMMAND(OUTPUT + ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/ssleay32.dll + DEPENDS ${CMAKE_SSL_DLL} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SSL_DLL} + ${CMake_BIN_DIR}/${CMAKE_CFG_INTDIR}/ssleay32.dll) + INSTALL(PROGRAMS ${CMAKE_EAY_DLL} ${CMAKE_SSL_DLL} DESTINATION bin) + ENDIF() + ENDIF() ENDIF(CMAKE_USE_OPENSSL) # Check for idn @@ -698,8 +713,7 @@ ENDFOREACH() CONFIGURE_FILE(${LIBCURL_SOURCE_DIR}/config.h.in ${LIBCURL_BINARY_DIR}/config.h) - -ADD_LIBRARY(cmcurl ${LIBRARY_TYPE} ${libCurl_SRCS}) +ADD_LIBRARY(cmcurl ${LIBRARY_TYPE} ${libCurl_SRCS} ${CMAKE_CURL_SSL_DLLS}) TARGET_LINK_LIBRARIES(cmcurl ${CURL_LIBS}) IF(CMAKE_BUILD_CURL_SHARED) SET_TARGET_PROPERTIES(cmcurl PROPERTIES DEFINE_SYMBOL BUILDING_LIBCURL diff --git a/Utilities/cmcurl/config.h.in b/Utilities/cmcurl/config.h.in index 6e74935a3d..e18af8ffe8 100644 --- a/Utilities/cmcurl/config.h.in +++ b/Utilities/cmcurl/config.h.in @@ -255,9 +255,6 @@ /* Define to 1 if you have the <libssh2.h> header file. */ #cmakedefine HAVE_LIBSSH2_H ${HAVE_LIBSSH2_H} -/* Define to 1 if you have the `ssl' library (-lssl). */ -#cmakedefine HAVE_LIBSSL ${HAVE_LIBSSL} - /* if zlib is available */ #cmakedefine HAVE_LIBZ ${HAVE_LIBZ} diff --git a/Utilities/cmcurl/curl/curl.h b/Utilities/cmcurl/curl/curl.h index 157c634a46..e586c4a8ca 100644 --- a/Utilities/cmcurl/curl/curl.h +++ b/Utilities/cmcurl/curl/curl.h @@ -312,7 +312,7 @@ typedef enum { CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ CURLE_FAILED_INIT, /* 2 */ CURLE_URL_MALFORMAT, /* 3 */ - CURLE_URL_MALFORMAT_USER, /* 4 - NOT USED */ + CURLE_NOT_BUILT_IN, /* 4 */ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ CURLE_COULDNT_RESOLVE_HOST, /* 6 */ CURLE_COULDNT_CONNECT, /* 7 */ diff --git a/Utilities/cmcurl/ssluse.c b/Utilities/cmcurl/ssluse.c index 55afb2446a..14d05ac658 100644 --- a/Utilities/cmcurl/ssluse.c +++ b/Utilities/cmcurl/ssluse.c @@ -1285,8 +1285,13 @@ Curl_ossl_connect_step1(struct connectdata *conn, req_method = TLSv1_client_method(); break; case CURL_SSLVERSION_SSLv2: +#ifdef OPENSSL_NO_SSL2 + failf(data, "OpenSSL was built without SSLv2 support"); + return CURLE_NOT_BUILT_IN; +#else req_method = SSLv2_client_method(); break; +#endif case CURL_SSLVERSION_SSLv3: req_method = SSLv3_client_method(); break; diff --git a/Utilities/cmcurl/strerror.c b/Utilities/cmcurl/strerror.c index 6304fe89d3..74c3457795 100644 --- a/Utilities/cmcurl/strerror.c +++ b/Utilities/cmcurl/strerror.c @@ -69,6 +69,10 @@ curl_easy_strerror(CURLcode error) case CURLE_URL_MALFORMAT: return "URL using bad/illegal format or missing URL"; + case CURLE_NOT_BUILT_IN: + return "A requested feature, protocol or option was not found built-in in" + " this libcurl due to a build-time decision."; + case CURLE_COULDNT_RESOLVE_PROXY: return "couldn't resolve proxy name"; @@ -287,7 +291,6 @@ curl_easy_strerror(CURLcode error) return "Error in the SSH layer"; /* error codes not used by current libcurl */ - case CURLE_URL_MALFORMAT_USER: case CURLE_FTP_USER_PASSWORD_INCORRECT: case CURLE_MALFORMAT_USER: case CURLE_BAD_CALLING_ORDER: |