aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-09-28 15:17:29 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-09-29 16:14:44 +0200
commit2a04bfaf3a2054222cc8a508ecd11727f2b2269b (patch)
tree90cbb813a679e620d2f44cedc12c3e680dbc2d36 /examples
parenta92c4e35ae97128e5fa5712d4a8f999c0de7816b (diff)
CMake: Ensure proper dependencies in bundle_shared
Ensure the shared qml module is built before it is bundled into the app's bundle dir on macOS. Pick-to: 6.2 Change-Id: I0b93fc54d1caa86070335347f5d2735eafe6819a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/shared/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/quick/shared/CMakeLists.txt b/examples/quick/shared/CMakeLists.txt
index 7922e5b135..5d23f0d16a 100644
--- a/examples/quick/shared/CMakeLists.txt
+++ b/examples/quick/shared/CMakeLists.txt
@@ -45,6 +45,10 @@ function(bundle_shared example)
# a PlugIns subdirectory in a macOS bundle.
# Copy the qmldir and shared library qml plugin.
+ # Ensure the executable depends on the plugin so the plugin is copied
+ # only after it was built.
+ add_dependencies(${example} ${PROJECT_NAME}_shared)
+
set(shared_dir "$<TARGET_FILE_DIR:${PROJECT_NAME}_shared>")
set(shared_qmldir_file "${shared_dir}/qmldir")
set(app_dir "$<TARGET_FILE_DIR:${example}>")