summaryrefslogtreecommitdiffstats
path: root/cmake/FindWrapOpenSSL.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix WrapOpenSSL packageJoerg Bornemann2022-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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. Pick-to: 6.2 6.3 Fixes: QTBUG-99623 Change-Id: Idd0e8a60fabd0c7772413d557442c0012b0b436c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Be more explicit about found OpenSSL variablesAlexandru Croitor2021-07-011-1/+7
| | | | | | | | | | | | Specifying the variables as required variable will show the found paths in the configure output. Pick-to: 6.2 Task-number: QTBUG-94355 Change-Id: I985a3585f37b38e25b6be4fae5d42c82e06517de Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Lowercase system includes and lib names for Windows, fix cross compilingMartin Storsjö2021-04-231-1/+1
| | | | | | | | | | | | | | | When cross compiling from a case sensitive file system, casing matters, and mingw headers and import libraries consistently use lowercase. This was uncovered by d385158d5213ef568b7629e2aa4a818016bbffac; prior to that, the schannel TLS plugin didn't end up built (at least when cross compiling). Fix other similar cases that can be found by grepping the repo. Change-Id: Ia696e17b7aaa979d7b7f5b0801383f338a8b585b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix FindWrapOpenSSL.cmake if OpenSSL::Crypto is UNKNOWN_LIBRARYJoerg Bornemann2021-02-111-1/+1
| | | | | | | | | | | The attempt to call target_link_libraries on OpenSSL::Crypto failed when this target was added as UNKNOWN library by FindOpenSSL.cmake. Instead, set the INTERFACE_LINK_LIBRARIES property directly. Pick-to: 6.1 6.0 Fixes: QTBUG-90925 Change-Id: Idbc1379c89480225fc7a8d417416ed20404a1122 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Fix HAVE_openssl config test when using static OpenSSLLi Xinwei2021-01-281-0/+12
| | | | | | | | | | | | | | | | | When using static OpenSSL, HAVE_openssl test will fail, because of unresolved external symbols. These symbols are from Ws2_32.lib and Crypt32.lib, which CMake does not link by default. In qmake build system, we can use OPENSSL_LIBS variable to specify these system libraries. But there is no similar variable in CMake build system. Accordingly, we should let OpenSSL::Crypto target link these libraries. Upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/19263 Pick-to: 6.0 Change-Id: I5f27790b251d0a0f71aaf2aed2b933aeb3326f1f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Handle finding of OpenSSL headers correctlyAlexandru Croitor2020-04-081-0/+21
In Coin when provisioning for Android, we download and configure the OpenSSL package, but don't actually build it. This means that find_package(OpenSSL) can find the headers, but not the library, and thus the package is marked as not found. Previously the openssl_headers feature used the result of finding the OpenSSL package, which led to it being disabled in the above described Android case. Introduce 2 new find scripts FindWrapOpenSSL and FindWrapOpenSSLHeaders. FindWrapOpenSSLHeaders wraps FindOpenSSL, and checks if the headers were found, regardless of the OpenSSL_FOUND value, which can be used for implementing the openssl_headers feature. FindWrapOpenSSL uses FindWrapOpenSSLHeaders, and simply wraps the OpenSSL target if available. The find scripts also have to set CMAKE_FIND_ROOT_PATH for Android. Otherwise when someone passes in an OPENSSL_ROOT_DIR, its value will always be prepended to the Android sysroot, causing the package not to be found. Adjust the mapping in helper.py to use the targets created by these find scripts. This also replaces the openssl/nolink target. Adjust the projects and tests to use the new target names. Adjust the compile tests for dtls and oscp to use the WrapOpenSSLHeaders target, so that the features can be enabled even if the library is dlopen-ed (like on Android). Task-number: QTBUG-83371 Change-Id: I738600e5aafef47a57e1db070be40116ca8ab995 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>