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>
This commit is contained in:
parent
58226a8b62
commit
5eb6815cd8
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user