diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-12-14 16:56:39 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-02-09 11:41:46 +0100 |
commit | 9278b3f567b395fa0188bd0da3ec4289f757d77e (patch) | |
tree | a932c997659d05c8ccb54b981aad5f5243c924f8 /cmake | |
parent | b767e02fafdc3592dc8b440cfc9e4d53027e480a (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.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index cf67442516..ee1d493821 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -340,6 +340,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 |