diff options
author | Harry Mallon <harry@codexdigital.com> | 2017-01-03 19:10:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-01-10 18:42:48 (GMT) |
commit | 696339a9d571ff7d37222296164dd738a6a2b042 (patch) | |
tree | ba3947fea3ba63dd9df6de2194525a3717f24225 /Modules/FindOpenSSL.cmake | |
parent | bd9b53ab33bb2185d526e8897cbd8f95c680b2c7 (diff) | |
download | CMake-696339a9d571ff7d37222296164dd738a6a2b042.zip CMake-696339a9d571ff7d37222296164dd738a6a2b042.tar.gz CMake-696339a9d571ff7d37222296164dd738a6a2b042.tar.bz2 |
FindOpenSSL: Check that both CRYPTO and SSL libraries are present
* Strawberry perl on Windows installs one that is found by the
default finder
While at it, de-duplicate code setting `OPENSSL_LIBRARIES`.
Diffstat (limited to 'Modules/FindOpenSSL.cmake')
-rw-r--r-- | Modules/FindOpenSSL.cmake | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 30fc5c6..6259ce1 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -204,7 +204,6 @@ if(WIN32 AND NOT CYGWIN) SSL_EAY_LIBRARY_DEBUG SSL_EAY_LIBRARY_RELEASE) set(OPENSSL_SSL_LIBRARY ${SSL_EAY_LIBRARY} ) set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_LIBRARY} ) - set(OPENSSL_LIBRARIES ${SSL_EAY_LIBRARY} ${LIB_EAY_LIBRARY} ) elseif(MINGW) # same player, for MinGW set(LIB_EAY_NAMES crypto libeay32) @@ -232,7 +231,6 @@ if(WIN32 AND NOT CYGWIN) mark_as_advanced(SSL_EAY LIB_EAY) set(OPENSSL_SSL_LIBRARY ${SSL_EAY} ) set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} ) - set(OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) unset(LIB_EAY_NAMES) unset(SSL_EAY_NAMES) else() @@ -264,7 +262,6 @@ if(WIN32 AND NOT CYGWIN) mark_as_advanced(SSL_EAY LIB_EAY) set(OPENSSL_SSL_LIBRARY ${SSL_EAY} ) set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} ) - set(OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) endif() else() @@ -298,8 +295,6 @@ else() set(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY}) set(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) - set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) - endif() function(from_hex HEX DEC) @@ -371,10 +366,13 @@ endif () include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ) + if (OPENSSL_VERSION) find_package_handle_standard_args(OpenSSL REQUIRED_VARS - OPENSSL_LIBRARIES + OPENSSL_SSL_LIBRARY + OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR VERSION_VAR OPENSSL_VERSION @@ -383,7 +381,8 @@ if (OPENSSL_VERSION) ) else () find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR" - OPENSSL_LIBRARIES + OPENSSL_SSL_LIBRARY + OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR ) endif () |