From 3d1464fc15b6fde298d925b898fd737d28e8f6eb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 8 Jul 2022 11:20:18 +0200 Subject: [PATCH] CMake: Process extra dependencies for plugin targets as well We started recording extra dependencies for the QtNetwork TLS plugin, but we never actually processed them to write out the necessary find_package calls. This broke static builds of qtopcua, because the OpenSSL::SSL target was no longer created in the root scope, but only in some child ones like src/opcua, whereas the target was referenced in generator expressions in a different sibling scope src/declarative_opcua, leading to errors like CMake Error at lib/cmake/Qt6/QtPrlHelpers.cmake:116 (file): Error evaluating generator expression: $ No target "OpenSSL::SSL" Call Stack (most recent call first): lib/cmake/Qt6/QtModuleHelpers.cmake:837 (qt_generate_prl_file) lib/cmake/Qt6/QtScopeFinalizerHelpers.cmake:21:EVAL:1 (qt_finalize_module) src/declarative_opcua/CMakeLists.txt:DEFERRED Make sure to process the extra deps for plugins as well. Amends d754e43721e4f40a8dffa8b69ef883ca383a4a61 Amends 3c233175523a61e734dd5cd9bdcbb2994566f7f0 Pick-to: 6.4 Task-number: QTBUG-96283 Change-Id: I11876e0844198b3a794bc06b6691ee694fd3b1c2 Reviewed-by: Alexey Edelev --- cmake/QtPostProcessHelpers.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index 5fc6144124..d3f917af8d 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -296,6 +296,13 @@ function(qt_internal_create_plugin_depends_file target) unset(optional_public_depends) set(target_deps_seen "") + + # Extra 3rd party targets who's packages should be considered dependencies. + get_target_property(extra_third_party_deps "${target}" _qt_extra_third_party_dep_targets) + if(NOT extra_third_party_deps) + set(extra_third_party_deps "") + endif() + qt_collect_third_party_deps(${target}) qt_internal_remove_qt_dependency_duplicates(target_deps "${target_deps}")