--- /dev/null
+# 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()
OPTION(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
MARK_AS_ADVANCED(CMAKE_USE_OPENSSL)
IF(CMAKE_USE_OPENSSL)
- CHECK_LIBRARY_EXISTS_CONCAT("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
- CHECK_LIBRARY_EXISTS_CONCAT("ssl" SSL_connect HAVE_LIBSSL)
+ IF(WIN32)
+ 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)
# Check for idn
)
ENDIF(CURL_MALLOC_DEBUG)
+IF(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
+ INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
+ENDIF()
+
IF(CURL_ZLIB AND ZLIB_FOUND)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
ENDIF()