summaryrefslogtreecommitdiffstats
path: root/cmake/QtPluginDependencies.cmake.in
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/QtPluginDependencies.cmake.in')
-rw-r--r--cmake/QtPluginDependencies.cmake.in59
1 files changed, 9 insertions, 50 deletions
diff --git a/cmake/QtPluginDependencies.cmake.in b/cmake/QtPluginDependencies.cmake.in
index f64cc77714..bcbb9bb5db 100644
--- a/cmake/QtPluginDependencies.cmake.in
+++ b/cmake/QtPluginDependencies.cmake.in
@@ -1,62 +1,21 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
set(@target@_FOUND FALSE)
# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;"
-set(_third_party_deps "@third_party_deps@")
-
-foreach(_target_dep ${_third_party_deps})
- list(GET _target_dep 0 pkg)
- list(GET _target_dep 1 is_optional)
- list(GET _target_dep 2 version)
- list(GET _target_dep 3 components)
- set(find_package_args "${pkg}")
- if(version)
- list(APPEND find_package_args "${version}")
- endif()
- if(components)
- string(REPLACE " " ";" components "${components}")
- list(APPEND find_package_args COMPONENTS ${components})
- endif()
-
- if(is_optional)
- if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
- list(APPEND find_package_args QUIET)
- endif()
- find_package(${find_package_args})
- else()
- find_dependency(${find_package_args})
- endif()
-endforeach()
+set(__qt_@target@_third_party_deps "@third_party_deps@")
+_qt_internal_find_third_party_dependencies("@target@" __qt_@target@_third_party_deps)
set(__qt_use_no_default_path_for_qt_packages "NO_DEFAULT_PATH")
if(QT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES)
set(__qt_use_no_default_path_for_qt_packages "")
endif()
-# TODO: The dependencies lookup mechanism is common for Modules and Plugins.
-# It should be moved to the common public helper file.
-#
# note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0"
-set(_target_deps "@target_deps@")
-foreach(_target_dep ${_target_deps})
- list(GET _target_dep 0 pkg)
- list(GET _target_dep 1 version)
-
- if (NOT ${pkg}_FOUND)
- set(pkg_names ${pkg})
- if(pkg MATCHES "(.*)Private$")
- set(pkg_names "${CMAKE_MATCH_1};${pkg}")
- endif()
- find_dependency(${pkg} ${version}
- NAMES
- ${pkg_names}
- PATHS
- @find_dependency_paths@
- ${_qt_additional_packages_prefix_path}
- ${_qt_additional_packages_prefix_path_env}
- ${QT_EXAMPLES_CMAKE_PREFIX_PATH}
- ${__qt_use_no_default_path_for_qt_packages}
- )
- endif()
-endforeach()
+set(__qt_@target@_target_deps "@target_deps@")
+set(__qt_@target@_find_dependency_paths "@find_dependency_paths@")
+_qt_internal_find_qt_dependencies("@target@" __qt_@target@_target_deps
+ __qt_@target@_find_dependency_paths)
set(@target@_FOUND TRUE)