From 3892e86d6e22e0693f4b8225058627a09d410aac Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 19 Jul 2022 18:29:22 +0200 Subject: CMake: Don't unset Qt6Qml_FOUND when including Qml plugins Removing the variable would cause nested find_dependency calls of FooQmlPluginDependencies.cmake files to look for the Qml package again and again. If we got to the point of including QmlPlugins.cmake, we already know that the Qml package was found. Set it to TRUE after every inclusion to avoid repeated Qml package loading. The second inclusion pass will ensure to set the found variable to FALSE in case if some dependency is actually missing. Amends aad4158959890b72afdd062614c1142c100c65b5 Pick-to: 6.4 Task-number: QTBUG-104998 Change-Id: I562a1c2ea0abac61453a743ab2e7d2f228de7ff0 Reviewed-by: Alexey Edelev --- cmake/QtPostProcessHelpers.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmake') diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index bbdec47d82..0d0762a1b0 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -450,9 +450,9 @@ if (__qt_qml_plugins_config_file_list AND NOT QT_SKIP_AUTO_QML_PLUGIN_INCLUSION) foreach(__qt_qml_plugin_config_file \${__qt_qml_plugins_config_file_list}) include(\${__qt_qml_plugin_config_file}) - # Temporarily unset any failure markers. + # Temporarily unset any failure markers and mark the Qml package as found. unset(\${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE) - unset(\${CMAKE_FIND_PACKAGE_NAME}_FOUND) + set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND TRUE) endforeach() # For the second round of inclusions, check and bail out early if there are errors. -- cgit v1.2.3