summaryrefslogtreecommitdiffstats
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-04-07 17:54:49 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-04-08 22:03:24 +0200
commite0346df1b21cb30b54ae8d4918addc9925fa8479 (patch)
treed45cfc3bc6a3d59507bc26f963d9eee57531b6b5 /tests/CMakeLists.txt
parent0a13c3a3f0ef1eb7274badac000db9ec584faeca (diff)
CMake: Handle finding of OpenSSL headers correctly
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>
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d1a395c9f3..3642db7ee3 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,7 +7,8 @@ if(QT_BUILD_STANDALONE_TESTS)
qt_find_package(WrapDBus1 PROVIDED_TARGETS dbus-1)
qt_find_package(ICU COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data)
qt_find_package(Threads PROVIDED_TARGETS Threads::Threads)
- qt_find_package(OpenSSL PROVIDED_TARGETS OpenSSL::OpenSSL)
+ qt_find_package(WrapOpenSSL PROVIDED_TARGETS WrapOpenSSL::WrapOpenSSL)
+ qt_find_package(WrapOpenSSLHeaders PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpenSSLHeaders)
# special case end
endif()
qt_build_tests()