From 3715cc356153bd8bc384ce4badfe6baece3d3768 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 14 Feb 2023 14:52:04 +0100 Subject: Add the NO_CMAKE_PACKAGE_REGISTRY option forwarding to qt_find_package Allow forwarding the NO_CMAKE_PACKAGE_REGISTRY option to the find_package call from qt_find_package. When we look for host tool packages the package dependencies are recorded in the cmake package registry. This leads to the situation when the lookup retry will use the package that is already found in host path instead of looking the right one in target paths. Adding the 'NO_CMAKE_PACKAGE_REGISTRY' to the qt_find_package calls suppresses records in cmake package registry and starts a clean search using target paths. Task-number: QTBUG-111140 Change-Id: I97ce1755b2f8e3413f1b0276fe26568b2f5efe33 Reviewed-by: Joerg Bornemann (cherry picked from commit 545400addd7935c87ec79596ac3010b4f9016a84) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtFindPackageHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtFindPackageHelpers.cmake b/cmake/QtFindPackageHelpers.cmake index 407e41b833..4dc2643939 100644 --- a/cmake/QtFindPackageHelpers.cmake +++ b/cmake/QtFindPackageHelpers.cmake @@ -18,7 +18,7 @@ endfunction() macro(qt_find_package) # Get the target names we expect to be provided by the package. - set(find_package_options CONFIG NO_MODULE MODULE REQUIRED) + set(find_package_options CONFIG NO_MODULE MODULE REQUIRED NO_CMAKE_PACKAGE_REGISTRY) set(options ${find_package_options} MARK_OPTIONAL) set(oneValueArgs MODULE_NAME QMAKE_LIB) set(multiValueArgs PROVIDED_TARGETS COMPONENTS OPTIONAL_COMPONENTS) -- cgit v1.2.3