summaryrefslogtreecommitdiffstats
path: root/cmake/QtPluginDependencies.cmake.in
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-06-17 12:04:16 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-18 07:10:56 +0000
commit2e2c8b8c29d8448892a0a90228b4254ef8411e8f (patch)
tree62c1a42f05f7e056d165de35bd0d70cc97c9860d /cmake/QtPluginDependencies.cmake.in
parent4dcedb8ca4ae0c9c533997074098297abbfcf1c3 (diff)
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 Fixes: QTBUG-94501 Change-Id: Ib48a7befcb70e20c3f21315897d51d3064b48134 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit b6c5e0667696c1d4abaf37f2224b2121b72cdebd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake/QtPluginDependencies.cmake.in')
-rw-r--r--cmake/QtPluginDependencies.cmake.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtPluginDependencies.cmake.in b/cmake/QtPluginDependencies.cmake.in
index 7bd1eef9aa..62eda2c5c0 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)