summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-12-14 16:56:39 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-01 16:53:37 +0000
commita61a9ddc617dc63963385edf20bfaa8259693958 (patch)
treeef45df0ccad5ce5764b6e6ea4d405662597154ed /cmake
parent23800a993e3ac5f725f222e51de909e451814684 (diff)
CMake: Copy FindFoo.cmake scripts to build dir in prefix builds
They are used by build dir Qt6FooConfig.cmake files in conjunction with export(EXPORT)'ed target files when building ExternalProjects against a non-installed Qt (or in a top-level build). Change-Id: I688caf1bd1b8a8fe7e549cebade2aef6f928bd6c Task-number: QTBUG-90820 Task-number: QTBUG-96232 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 1273ffb0002b14d952807c250dbcc6228f60ff26) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseGlobalTargets.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index 1869ac9a15..ebc0bd4e64 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -338,6 +338,17 @@ qt_copy_or_install(DIRECTORY cmake/
PATTERN "3rdparty" EXCLUDE
)
+# In prefix builds we also need to copy the files into the build config directory, so that the
+# build-dir Qt6Config.cmake finds the files when building examples as ExternalProjects.
+if(QT_WILL_INSTALL)
+ file(COPY cmake/
+ DESTINATION "${__GlobalConfig_build_dir}"
+ FILES_MATCHING PATTERN "Find*.cmake"
+ PATTERN "tests" EXCLUDE
+ PATTERN "3rdparty" EXCLUDE
+ )
+endif()
+
if(MACOS)
qt_copy_or_install(FILES
cmake/macos/MacOSXBundleInfo.plist.in