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-30 22:24:01 +0200
commit61b22013b192da2cfc3a061f2f5ffa65682f368b (patch)
tree2f80e24bdd48bacc00d836c9b1394355011c6b3d /examples
parent4de2cbfb835bdf9411ef25f86927e4e174b9c900 (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. 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> (cherry picked from commit 2a04bfaf3a2054222cc8a508ecd11727f2b2269b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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}>")