FindOpenSSL: Restore support for crypto-only result

Since commit v3.8.0-rc1~132^2 (FindOpenSSL: Check that both CRYPTO and
SSL libraries are present, 2017-01-03) we require both crypto and ssl
libraries to be present.  This makes sense because `OPENSSL_LIBRARIES`
lists both and breaks when one is not found.  However, prior to that
fix we supported finding only the crypto library and using it through
the imported target.  Drop the requirement for ssl to restore support
for using crypto alone.

Later this module should be taught to support the `COMPONENTS` argument
of `find_package`.

Fixes: #16882
This commit is contained in:
Brad King
2017-05-15 10:05:44 -04:00
parent 8bd6af0d63
commit 8b41045393

View File

@@ -375,7 +375,7 @@ set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
if (OPENSSL_VERSION)
find_package_handle_standard_args(OpenSSL
REQUIRED_VARS
OPENSSL_SSL_LIBRARY
#OPENSSL_SSL_LIBRARY # FIXME: require based on a component request?
OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR
VERSION_VAR
@@ -385,7 +385,7 @@ 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_SSL_LIBRARY
#OPENSSL_SSL_LIBRARY # FIXME: require based on a component request?
OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR
)