From 4c10461a877d8ca8f18c952c2c143320337d04a7 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Thu, 30 Jul 2015 16:09:34 +0200 Subject: [PATCH 1/2] FindOpenSSL: Remove extra whitespace --- Modules/FindOpenSSL.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 3adc26926..ad2258043 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -155,9 +155,9 @@ if(WIN32 AND NOT CYGWIN) mark_as_advanced(LIB_EAY_LIBRARY_DEBUG LIB_EAY_LIBRARY_RELEASE 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} ) + 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 libeay32) @@ -185,9 +185,9 @@ 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} ) + 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() @@ -213,9 +213,9 @@ 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} ) + set(OPENSSL_SSL_LIBRARY ${SSL_EAY} ) + set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY} ) + set(OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} ) endif() else() From fbcbf7f29d630c8a291f0d0e543defbf1b8208df Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Thu, 30 Jul 2015 16:09:34 +0200 Subject: [PATCH 2/2] FindOpenSSL: De-duplicate find_library path suffixes on Windows Store the path suffixes in a variable and reference it in each find_library call. --- Modules/FindOpenSSL.cmake | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index ad2258043..7545d9403 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -99,15 +99,20 @@ if(WIN32 AND NOT CYGWIN) # We are using the libraries located in the VC subdir instead of the parent directory eventhough : # libeay32MD.lib is identical to ../libeay32.lib, and # ssleay32MD.lib is identical to ../ssleay32.lib + + set(_OPENSSL_PATH_SUFFIXES + "lib" + "VC" + "lib/VC" + ) + find_library(LIB_EAY_DEBUG NAMES libeay32MDd libeay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES - "lib" - "VC" - "lib/VC" + ${_OPENSSL_PATH_SUFFIXES} ) find_library(LIB_EAY_RELEASE @@ -116,9 +121,7 @@ if(WIN32 AND NOT CYGWIN) libeay32 ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES - "lib" - "VC" - "lib/VC" + ${_OPENSSL_PATH_SUFFIXES} ) find_library(SSL_EAY_DEBUG @@ -127,9 +130,7 @@ if(WIN32 AND NOT CYGWIN) ssleay32d ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES - "lib" - "VC" - "lib/VC" + ${_OPENSSL_PATH_SUFFIXES} ) find_library(SSL_EAY_RELEASE @@ -139,9 +140,7 @@ if(WIN32 AND NOT CYGWIN) ssl ${_OPENSSL_ROOT_HINTS_AND_PATHS} PATH_SUFFIXES - "lib" - "VC" - "lib/VC" + ${_OPENSSL_PATH_SUFFIXES} ) set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")