curl: Use find_package(OpenSSL)

Change the code to use the standard CMake FindOpenSSL instead of the
handcrafted attempt that was there before.
This commit is contained in:
Bill Hoffman 2012-09-05 17:25:44 -04:00 committed by Brad King
parent 2da17ef797
commit c2f47590ef
2 changed files with 4 additions and 15 deletions

View File

@ -169,22 +169,14 @@ 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)

View File

@ -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}