summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-01-07 10:37:50 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-07 13:14:38 +0000
commit8a4ce7b6e68ffe78e2300b57fef9ee3d27d8e700 (patch)
tree2581614d36495890298a92f781510a6b176e208e /cmake
parent4ef94a6a5e7e85900c4665515c42737f51a5a757 (diff)
CMake: Fix WrapOpenSSL package
Since f19ce3898e0257dac1112754b1a84c24486bda01 we link OpenSSL to QTlsBackendOpenSSLPlugin instead of QtNetwork itself. In dependent Qt repositories this leads to the following situation: QTlsBackendOpenSSLPlugin's dependencies call find_dependency(WrapOpenSSLHeaders), and OpenSSL_FOUND is set to ON in that scope. Later, we call find_package(WrapOpenSSL) in a different scope. find_package(WrapOpenSSLHeaders) bails out early, because the target WrapOpenSSLHeaders::WrapOpenSSLHeaders exists. find_package(OpenSSL) is not called again. The check for OpenSSL_FOUND fails, because the variable is not visible in the scope of FindWrapOpenSSL.cmake, and we don't create the WrapOpenSSL::WrapOpenSSL target. Fix this by checking for the existence of the target OpenSSL::SSL instead of the OpenSSL_FOUND variable. Fixes: QTBUG-99623 Change-Id: Idd0e8a60fabd0c7772413d557442c0012b0b436c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit faa26be44cd7306c8ec2276131414866d3de712d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindWrapOpenSSL.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/FindWrapOpenSSL.cmake b/cmake/FindWrapOpenSSL.cmake
index 486686d338..7b6dccb1d2 100644
--- a/cmake/FindWrapOpenSSL.cmake
+++ b/cmake/FindWrapOpenSSL.cmake
@@ -10,7 +10,7 @@ set(WrapOpenSSL_FOUND OFF)
# Reuse logic from the headers find script.
find_package(WrapOpenSSLHeaders ${WrapOpenSSL_FIND_VERSION})
-if(OpenSSL_FOUND)
+if(TARGET OpenSSL::SSL)
if(WIN32)
get_target_property(libType OpenSSL::Crypto TYPE)
if(libType STREQUAL "ALIAS")