CMake: Export 3rd party dep info also for the Qt6 package

It usually looks up the Threads target, so we want it to be recorded
as a provided target.

Amends 58eefbd0b6169d0749b312268c1ae1e594e04362

Pick-to: 6.8
Change-Id: I0f06aaae98fd99da8fb6436d232a147e163580a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Alexandru Croitor 2024-07-01 19:10:26 +02:00
parent e6c77a0b7e
commit 8c0fb7e07d
2 changed files with 13 additions and 1 deletions

View File

@ -15,7 +15,7 @@ _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_deps_extra_info@
@third_party_extra@
# Don't propagate REQUIRED so we don't immediately FATAL_ERROR, rather let the find_dependency calls

View File

@ -400,10 +400,22 @@ function(qt_internal_create_qt6_dependencies_file)
unset(depends)
unset(optional_public_depends)
set(third_party_deps "")
set(third_party_deps_seen "")
set(third_party_deps_package_components_ids "")
# We need to collect third party deps that are set on the public Platform target,
# like Threads::Threads.
# This mimics find_package part of the CONFIG += thread assignment in mkspecs/features/qt.prf.
qt_collect_third_party_deps(${actual_target})
qt_internal_collect_third_party_dep_packages_info("${INSTALL_CMAKE_NAMESPACE}"
"${third_party_deps_package_components_ids}"
packages_info)
set(third_party_deps_extra_info "")
if(packages_info)
string(APPEND third_party_deps_extra_info "${packages_info}")
endif()
# For Threads we also need to write an extra variable assignment.
set(third_party_extra "")