summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuildInternals
diff options
context:
space:
mode:
authorLi Xinwei <1326710505@qq.com>2021-08-10 21:19:53 +0800
committerLi Xinwei <1326710505@qq.com>2021-08-11 01:31:03 +0800
commit1a8de144b64fe665d3c0b34e329c9454d97e1523 (patch)
treead9ced93a9254e833e4deecf5f3436491d498c44 /cmake/QtBuildInternals
parent41d6a2673124dfb3e4d4c98b9c631ce730d17e6c (diff)
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuildInternals')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index 7ebe0a5744..c3c2f19761 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()