diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2023-02-07 15:37:05 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2023-02-07 15:38:20 (GMT) |
commit | 652f34eab99a6055caf821c1cc03eb40a83b3207 (patch) | |
tree | 0b920877ea33c6616aad82cdcc1982fdaa75d470 | |
parent | 26f962f8b1009587d101b8ede57e42e31c522b01 (diff) | |
download | CMake-652f34eab99a6055caf821c1cc03eb40a83b3207.zip CMake-652f34eab99a6055caf821c1cc03eb40a83b3207.tar.gz CMake-652f34eab99a6055caf821c1cc03eb40a83b3207.tar.bz2 |
FindOpenSSL: Use static pkgconfig if OPENSSL_USE_STATIC_LIBS=ON
Fixes: #24395
-rw-r--r-- | Modules/FindOpenSSL.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 78b1919..f876f43 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -118,9 +118,14 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) ("${crypto_library}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))) set(_OpenSSL_has_dependencies TRUE) unset(_OpenSSL_has_dependency_zlib) - if(_OPENSSL_LIBRARIES) + if(OPENSSL_USE_STATIC_LIBS) + set(_OpenSSL_libs "${_OPENSSL_STATIC_LIBRARIES}") + else() + set(_OpenSSL_libs "${_OPENSSL_LIBRARIES}") + endif() + if(_OpenSSL_libs) unset(_OpenSSL_has_dependency_dl) - foreach(_OPENSSL_DEP_LIB IN LISTS _OPENSSL_LIBRARIES) + foreach(_OPENSSL_DEP_LIB IN LISTS _OpenSSL_libs) if (_OPENSSL_DEP_LIB STREQUAL "ssl" OR _OPENSSL_DEP_LIB STREQUAL "crypto") # ignoring: these are the targets elseif(_OPENSSL_DEP_LIB STREQUAL CMAKE_DL_LIBS) @@ -137,6 +142,7 @@ macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library) set(_OpenSSL_has_dependency_dl TRUE) find_package(Threads) endif() + unset(_OpenSSL_libs) else() set(_OpenSSL_has_dependencies FALSE) endif() |