From b6c5e0667696c1d4abaf37f2224b2121b72cdebd Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 17 Jun 2021 12:04:16 +0200 Subject: CMake: Handle OPTIONAL_COMPONENTS in qt_find_package The optional components arguments were not handled before which caused the recorded package information for static builds to be incorrect, it only recorded the package name without the component. Remove REQUIRED_COMPONENTS TODO, there is no such find_package option, it's already handled by the regular COMPONENTS code path. Amends 07b6d3367debd8f15974abf0f5cdf48f0fe3a536 Pick-to: 6.1 6.2 Fixes: QTBUG-94501 Change-Id: Ib48a7befcb70e20c3f21315897d51d3064b48134 Reviewed-by: Qt CI Bot Reviewed-by: Dominik Holland Reviewed-by: Joerg Bornemann --- cmake/QtPluginDependencies.cmake.in | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmake/QtPluginDependencies.cmake.in') diff --git a/cmake/QtPluginDependencies.cmake.in b/cmake/QtPluginDependencies.cmake.in index f64cc77714..dfa642cc50 100644 --- a/cmake/QtPluginDependencies.cmake.in +++ b/cmake/QtPluginDependencies.cmake.in @@ -8,6 +8,7 @@ foreach(_target_dep ${_third_party_deps}) list(GET _target_dep 1 is_optional) list(GET _target_dep 2 version) list(GET _target_dep 3 components) + list(GET _target_dep 4 optional_components) set(find_package_args "${pkg}") if(version) list(APPEND find_package_args "${version}") @@ -16,6 +17,10 @@ foreach(_target_dep ${_third_party_deps}) string(REPLACE " " ";" components "${components}") list(APPEND find_package_args COMPONENTS ${components}) endif() + if(optional_components) + string(REPLACE " " ";" optional_components "${optional_components}") + list(APPEND find_package_args OPTIONAL_COMPONENTS ${optional_components}) + endif() if(is_optional) if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) -- cgit v1.2.3