mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
Added basic OpenSSL support in CMake scripts (Thanks to Bill Hoffman)
This commit is contained in:
parent
168fb3a8d8
commit
9a184e0bb1
19
CMake/FindOpenSSL.cmake
Normal file
19
CMake/FindOpenSSL.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Extension of the standard FindOpenSSL.cmake
|
||||||
|
# Adds OPENSSL_INCLUDE_DIRS and libeay32
|
||||||
|
INCLUDE("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
|
||||||
|
|
||||||
|
# Bill Hoffman told that libeay32 is necessary for him:
|
||||||
|
FIND_LIBRARY(SSL_LIBEAY NAMES libeay32)
|
||||||
|
|
||||||
|
IF(OPENSSL_FOUND)
|
||||||
|
IF(SSL_LIBEAY)
|
||||||
|
LIST(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
|
||||||
|
ELSE()
|
||||||
|
SET(OPENSSL_FOUND FALSE)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
IF(OPENSSL_FOUND)
|
||||||
|
SET(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||||
|
ENDIF()
|
@ -187,8 +187,19 @@ CHECK_LIBRARY_EXISTS_CONCAT("winmm" getch HAVE_LIBWINMM)
|
|||||||
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)
|
||||||
CHECK_LIBRARY_EXISTS_CONCAT("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
|
IF(WIN32)
|
||||||
CHECK_LIBRARY_EXISTS_CONCAT("ssl" SSL_connect HAVE_LIBSSL)
|
FIND_PACKAGE(OpenSSL)
|
||||||
|
IF(OPENSSL_FOUND)
|
||||||
|
SET(USE_SSLEAY TRUE)
|
||||||
|
SET(USE_OPENSSL TRUE)
|
||||||
|
LIST(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
|
||||||
|
ENDIF()
|
||||||
|
#FIND_LIBRARY(LIBEAY NAMES libeay32)
|
||||||
|
#LIST(APPEND CURL_LIBS ${LIBEAY} )
|
||||||
|
ELSE(WIN32)
|
||||||
|
CHECK_LIBRARY_EXISTS_CONCAT("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
|
||||||
|
CHECK_LIBRARY_EXISTS_CONCAT("ssl" SSL_connect HAVE_LIBSSL)
|
||||||
|
ENDIF(WIN32)
|
||||||
ENDIF(CMAKE_USE_OPENSSL)
|
ENDIF(CMAKE_USE_OPENSSL)
|
||||||
|
|
||||||
# Check for idn
|
# Check for idn
|
||||||
|
@ -110,6 +110,10 @@ IF(CURL_MALLOC_DEBUG)
|
|||||||
)
|
)
|
||||||
ENDIF(CURL_MALLOC_DEBUG)
|
ENDIF(CURL_MALLOC_DEBUG)
|
||||||
|
|
||||||
|
IF(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
|
||||||
|
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(CURL_ZLIB AND ZLIB_FOUND)
|
IF(CURL_ZLIB AND ZLIB_FOUND)
|
||||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
Loading…
Reference in New Issue
Block a user