FindOpenSSL: Search in more-specific directories before less-specific

Since commit v3.6.0-rc1~182^2 (FindOpenSSL: Prefer libs early in search
path regardless of name, 2016-04-04) we use the `NAMES_PER_DIR` option
to `find_library` calls to consider all names in each directory before
moving on to the next directory.  Fix our library search directory
ordering to place more-specific (e.g. VC/) directories before the
general directories.  Otherwise they may never be considered.

Closes: #16320
This commit is contained in:
Brad King 2016-09-22 07:55:27 -04:00
parent 2c2ffd3874
commit 0d8c5ba42a
1 changed files with 6 additions and 6 deletions

View File

@ -142,15 +142,15 @@ if(WIN32 AND NOT CYGWIN)
if(OPENSSL_USE_STATIC_LIBS) if(OPENSSL_USE_STATIC_LIBS)
set(_OPENSSL_PATH_SUFFIXES set(_OPENSSL_PATH_SUFFIXES
"lib"
"VC/static"
"lib/VC/static" "lib/VC/static"
"VC/static"
"lib"
) )
else() else()
set(_OPENSSL_PATH_SUFFIXES set(_OPENSSL_PATH_SUFFIXES
"lib"
"VC"
"lib/VC" "lib/VC"
"VC"
"lib"
) )
endif () endif ()
@ -227,8 +227,8 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS} ${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES PATH_SUFFIXES
"lib"
"lib/MinGW" "lib/MinGW"
"lib"
) )
find_library(SSL_EAY find_library(SSL_EAY
@ -237,8 +237,8 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS} ${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES PATH_SUFFIXES
"lib"
"lib/MinGW" "lib/MinGW"
"lib"
) )
mark_as_advanced(SSL_EAY LIB_EAY) mark_as_advanced(SSL_EAY LIB_EAY)