From 1a8de144b64fe665d3c0b34e329c9454d97e1523 Mon Sep 17 00:00:00 2001 From: Li Xinwei <1326710505@qq.com> Date: Tue, 10 Aug 2021 21:19:53 +0800 Subject: [PATCH] Copy Find*.cmake to ${QT_BUILD_DIR}/lib/cmake/Qt6 In top-level builds, when configuring qtsensors, the directory of FindWMF.cmake isn't in ${CMAKE_MODULE_PATH}, this makes CMake couldn't find WMF. On Windows, QtMultimedia requires WMF. If WMF couldn't be found, QtMultimedia will also be treated as NOT FOUND. QtSensors has an optional dependency to QtMultimedia. If QtMultimedia couldn't be found, CMake will warn. Copy Find*.cmake to ${QT_BUILD_DIR}/lib/cmake/Qt6, to make sure these files could be found by CMake. Fixes: QTBUG-95655 Pick-to: 6.2 Change-Id: I87d14c9a7becd0ec493e00c297b2e01fc0ad0f96 Reviewed-by: Alexandru Croitor --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 7ebe0a5744b..c3c2f197617 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -451,6 +451,7 @@ macro(qt_build_repo_end) # Install the repo-specific cmake find modules. qt_path_join(__qt_repo_install_dir ${QT_CONFIG_INSTALL_DIR} ${INSTALL_CMAKE_NAMESPACE}) + qt_path_join(__qt_repo_build_dir ${QT_CONFIG_BUILD_DIR} ${INSTALL_CMAKE_NAMESPACE}) if(NOT PROJECT_NAME STREQUAL "QtBase") if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -458,6 +459,12 @@ macro(qt_build_repo_end) DESTINATION "${__qt_repo_install_dir}" FILES_MATCHING PATTERN "Find*.cmake" ) + if(QT_SUPERBUILD AND QT_WILL_INSTALL) + file(COPY cmake/ + DESTINATION "${__qt_repo_build_dir}" + FILES_MATCHING PATTERN "Find*.cmake" + ) + endif() endif() endif()