From 654431286931a70645fc3be39570f9109c95fe9e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 18 Aug 2021 18:41:18 +0200 Subject: CMake: Pass Qt6_FIND_VERSION in Qt6Config when looking for components Pass Qt6_FIND_VERSION to components when the find_package(Qt6 ${ver} COMPONENTS Foo) signature is used. Create a ConfigVersion file for BuildInternals, so that BuildInternals passes the version check. Fix qt_configure_file to look in the _qt_6_config_cmake_dir folder for the template file rather than Qt6_DIR, because Qt6_DIR might be accidentally unset after a failed find_package(Qt6) call and the error is not helpful then. We already pass versions everywhere else when looking for dependencies, like in ModuleDependencies.cmake.in, PluginDependencies.cmake.in, ModuleToolsDependencies.cmake.in. Pick-to: 6.2 Fixes: QTBUG-91737 Change-Id: Ief1da0c6f239c935385e7ce662951e85ccfdf130 Reviewed-by: Qt CI Bot Reviewed-by: Joerg Bornemann --- cmake/QtConfig.cmake.in | 1 + 1 file changed, 1 insertion(+) (limited to 'cmake/QtConfig.cmake.in') diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index 7ad92faeb2..75e15226dd 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -150,6 +150,7 @@ foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS}) endif() find_package(@INSTALL_CMAKE_NAMESPACE@${module} + ${@INSTALL_CMAKE_NAMESPACE@_FIND_VERSION} ${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET} PATHS ${_qt_cmake_dir} -- cgit v1.2.3