From 4ba1faef68679cedecab64aaa78778fd660802b8 Mon Sep 17 00:00:00 2001 From: Li Xinwei <1326710505@qq.com> Date: Tue, 10 Aug 2021 21:19:53 +0800 Subject: 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 Change-Id: I87d14c9a7becd0ec493e00c297b2e01fc0ad0f96 Reviewed-by: Alexandru Croitor (cherry picked from commit 1a8de144b64fe665d3c0b34e329c9454d97e1523) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 24790c7d65..f77f1bb8b0 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() -- cgit v1.2.3