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>
This commit is contained in:
Alexandru Croitor 2021-09-28 15:17:29 +02:00
parent a92c4e35ae
commit 2a04bfaf3a
1 changed files with 4 additions and 0 deletions

View File

@ -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}>")