qt5base-lts/cmake/QtConfigDependencies.cmake.in
Alexandru Croitor 7b24ffa936 CMake: Improve Qt6HostInfo package lookup condition
Instead of checking if QT_HOST_PATH is set during user project
configuration to find out if Qt6HostInfo should be looked up,
record if QT_HOST_PATH was provided during Qt configuration
into Qt6Dependencies.cmake and look up the package in a user
project based on that information.

This improves handling of the case where cmake is directly used
to configure a Qt project (instead of qt-cmake), which means no
QT_HOST_PATH might be set by the user, and then cmake would error out
saying that e.g. Qt6CoreTools is not found, instead of saying that
Qt6HostInfo is not found.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I0377d5440e4b5b295af73cfd4b5188f61d48e440
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:22 +02:00

18 lines
751 B
CMake

set(@INSTALL_CMAKE_NAMESPACE@_FOUND FALSE)
set(__qt_platform_requires_host_info_package "@platform_requires_host_info_package@")
_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@
# 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)