summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-05-31 10:49:17 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-05-31 15:47:44 +0200
commita94bf417ac36396aed14f12f84e4dd610a61d1e4 (patch)
tree013671534593484d58d72f57025cc79fce2a0cda
parentf78b9082cb0bd4946087b3aa1b962824c40a2824 (diff)
CMake: Fix No target "OpenSSL::SSL" error during prl generation
The issue is similar to 4c6292686259e4e232f29cb6fd6c79065e9fa96d in qt/tqtc-qtserialport. Network static plugin Config files are not loaded due to tqtc- prefixes in dependencies.yaml. The OpenSSL non-global imported target was only created in the opcua module subdirectory scope, which made it unavailable for prl processing in the plugin directory scope. Move the find_package call higher in the directory tree so that it can be seen by all Qt libraries. Fixes: QTBUG-103905 Task-number: QTBUG-102883 Change-Id: I9f7249ebcf558007abfcd269b5f42b322e1fb17e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
-rw-r--r--src/CMakeLists.txt7
-rw-r--r--src/opcua/configure.cmake4
-rw-r--r--src/plugins/opcua/open62541/CMakeLists.txt4
3 files changed, 7 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a591d66..9fbc187 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,12 @@
# Generated from src.pro.
+# Find OpenSSL at a directory scope which is common to both the module and plugin
+if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" OR NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
+ OR NOT CMAKE_SYSTEM_VERSION STREQUAL "10")
+ qt_find_package(WrapOpenSSL 1.1 PROVIDED_TARGETS WrapOpenSSL::WrapOpenSSL
+ MODULE_NAME network QMAKE_LIB openssl)
+endif()
+
add_subdirectory(opcua)
add_subdirectory(plugins)
if(TARGET Qt::Quick)
diff --git a/src/opcua/configure.cmake b/src/opcua/configure.cmake
index 965054d..04fa5c7 100644
--- a/src/opcua/configure.cmake
+++ b/src/opcua/configure.cmake
@@ -14,10 +14,6 @@ if (INPUT_open62541 STREQUAL "system")
qt_find_package(Open62541 PROVIDED_TARGETS open62541)
endif()
qt_find_package(Uacpp PROVIDED_TARGETS uacpp)
-
-if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" OR NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR NOT CMAKE_SYSTEM_VERSION STREQUAL "10")
- find_package(WrapOpenSSL 1.1)
-endif()
# special case end
#### Tests
diff --git a/src/plugins/opcua/open62541/CMakeLists.txt b/src/plugins/opcua/open62541/CMakeLists.txt
index b882092..aca061c 100644
--- a/src/plugins/opcua/open62541/CMakeLists.txt
+++ b/src/plugins/opcua/open62541/CMakeLists.txt
@@ -51,10 +51,6 @@ qt_internal_extend_target(QOpen62541Plugin CONDITION QT_FEATURE_open62541 AND NO
#special case end
# special case begin
-if (QT_FEATURE_open62541_security AND NOT QT_FEATURE_system_open62541)
- find_package(WrapOpenSSL 1.1)
-endif()
-
qt_internal_extend_target(QOpen62541Plugin CONDITION QT_FEATURE_open62541_security AND WrapOpenSSL_FOUND AND QT_FEATURE_open62541 AND NOT QT_FEATURE_system_open62541
DEFINES
UA_ENABLE_ENCRYPTION