diff options
Diffstat (limited to 'cmake/QtConfigDependencies.cmake.in')
-rw-r--r-- | cmake/QtConfigDependencies.cmake.in | 66 |
1 files changed, 21 insertions, 45 deletions
diff --git a/cmake/QtConfigDependencies.cmake.in b/cmake/QtConfigDependencies.cmake.in index b23b6681eb..9824f8525c 100644 --- a/cmake/QtConfigDependencies.cmake.in +++ b/cmake/QtConfigDependencies.cmake.in @@ -1,51 +1,27 @@ -set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCIES_FOUND FALSE) +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +set(@INSTALL_CMAKE_NAMESPACE@_FOUND FALSE) + +set(__qt_platform_requires_host_info_package "@platform_requires_host_info_package@") +set(__qt_platform_initial_qt_host_path "@qt_host_path_absolute@") +set(__qt_platform_initial_qt_host_path_cmake_dir "@qt_host_path_cmake_dir_absolute@") + +_qt_internal_setup_qt_host_path( + "${__qt_platform_requires_host_info_package}" + "${__qt_platform_initial_qt_host_path}" + "${__qt_platform_initial_qt_host_path_cmake_dir}") +_qt_internal_find_host_info_package(${__qt_platform_requires_host_info_package}) # note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;" set(__qt_third_party_deps "@third_party_deps@") @third_party_extra@ -foreach(__qt_target_dep ${__qt_third_party_deps}) - list(GET __qt_target_dep 0 __qt_pkg) - list(GET __qt_target_dep 1 __qt_is_optional) - list(GET __qt_target_dep 2 __qt_version) - list(GET __qt_target_dep 3 __qt_components) - list(GET __qt_target_dep 4 __qt_optional_components) - set(__qt_find_package_args "${__qt_pkg}") - if(__qt_version) - list(APPEND __qt_find_package_args "${__qt_version}") - endif() - if(__qt_components) - string(REPLACE " " ";" __qt_components "${__qt_components}") - list(APPEND __qt_find_package_args COMPONENTS ${__qt_components}) - endif() - if(__qt_optional_components) - string(REPLACE " " ";" __qt_optional_components "${__qt_optional_components}") - list(APPEND __qt_find_package_args OPTIONAL_COMPONENTS ${__qt_optional_components}) - endif() - - # Already build an error message, because find_dependency calls return() on failure. - set(__qt_message "\nPackage: ${__qt_pkg}") - if(__qt_version) - string(APPEND __qt_message "\nVersion: ${__qt_version}") - endif() - if(__qt_components) - string(APPEND __qt_message "\nComponents: ${__qt_components}") - endif() - if(__qt_optional_components) - string(APPEND __qt_message "\nComponents: ${__qt_optional_components}") - endif() - set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCY_NOT_FOUND_MESSAGE "${__qt_message}") - - if(__qt_is_optional) - if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) - list(APPEND __qt_find_package_args QUIET) - endif() - find_package(${__qt_find_package_args}) - else() - find_dependency(${__qt_find_package_args}) - endif() -endforeach() - -set(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCIES_FOUND TRUE) -unset(@INSTALL_CMAKE_NAMESPACE@_DEPENDENCY_NOT_FOUND_MESSAGE) +# Don't propagate REQUIRED so we don't immediately FATAL_ERROR, rather let the find_dependency calls +# set _NOT_FOUND_MESSAGE which will be displayed by the includer of the Dependencies file. +set(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED FALSE) + +_qt_internal_find_third_party_dependencies(@INSTALL_CMAKE_NAMESPACE@ __qt_third_party_deps) + +set(@INSTALL_CMAKE_NAMESPACE@_FOUND TRUE) |