diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2024-03-14 11:21:52 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2024-03-27 18:57:34 +0100 |
commit | 8f741c5496e1aed071db42895fb465bc0419cd48 (patch) | |
tree | fbf826e81d9c3f5f580042407c420e336d1d4c22 /examples/quick/views/CMakeLists.txt | |
parent | ab6abd8ca26ab29860495750261a1a5f5367793a (diff) |
CMake: Enable macOS POST_BUILD deployment for in-tree examples
When building all examples in-tree, we might not want to run the
deployment / installation code for each example due to time and space
constraints, but we still want to be able to run the examples from the
build dir.
The qml deployment API has a useful MACOS_BUNDLE_POST_BUILD option
that ensures a macOS app bundle can run from the build dir /before/
installation (by symlinking plugins into the build dir).
We couldn't use the API and option for a variety of "reasons", so we
copy pasted a bunch of similar code in each example (bundle_shared
and QtBundleQmlModuleForMacOS.cmake).
This change addresses most of the reasons.
Previously when qtdeclarative examples were built in-tree, they
would not have the their qml deployment finalizer executed at all,
because it is only run when the Qt6QmlConfigExtras.cmake file is
loaded, and that wasn't loaded when qtdeclarative itself is built.
This meant that an example calling qt6_generate_deploy_qml_app_script,
would get an error like:
No QML imports information recorded for target ${target}. The
target must be an executable and qt_add_qml_module() must have been
called with it. If using a CMake version lower than 3.19, ensure that
the executable is manually finalized with qt_finalize_target().
Missing file:
qtdeclarative/.qt/deploy_qml_imports/${target}.cmake
Make sure we append the finalizer to the Qml target also when it is
built. This will cause it to run for in-tree examples.
Adjust the deployment skipping code to allow running the
MACOS_BUNDLE_POST_BUILD step even if deployment itself will be
skipped. This is especially important for no-prefix builds, where
there is no install step and we want examples to run from the build
dir.
Pick-to: 6.7
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-102057
Change-Id: I68e23b102f753037ee49a91b78c18311c8f2ae97
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/quick/views/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions