aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/threading/CMakeLists.txt
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-08-31 10:45:07 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-09-04 08:46:37 +0200
commit23ddc51e5e44646d5b54d46414c0a60895d880b5 (patch)
tree1d6bc453ca07f37cf1739ed7f189e69ddfd00497 /examples/quick/threading/CMakeLists.txt
parent9867bc18e1716fa5cf7b4c02830d92513d8fba52 (diff)
Fix threading example to use QML modules
Pick-to: 6.2 Change-Id: I973244a0546e668ba8c65e573747e08f60a506c0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples/quick/threading/CMakeLists.txt')
-rw-r--r--examples/quick/threading/CMakeLists.txt64
1 files changed, 18 insertions, 46 deletions
diff --git a/examples/quick/threading/CMakeLists.txt b/examples/quick/threading/CMakeLists.txt
index 08e140ae81..86e17ac1b3 100644
--- a/examples/quick/threading/CMakeLists.txt
+++ b/examples/quick/threading/CMakeLists.txt
@@ -20,66 +20,38 @@ find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS Qml)
-qt_add_executable(threading
+add_subdirectory("../shared" "shared")
+
+qt_add_executable(threadingexample
main.cpp
)
-set_target_properties(threading PROPERTIES
+set_target_properties(threadingexample PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(threading PUBLIC
+target_link_libraries(threadingexample PUBLIC
Qt::Core
Qt::Gui
Qt::Qml
Qt::Quick
+ threading_shared
)
-
-# Resources:
-set(threading_resource_files
- "threadedlistmodel/dataloader.mjs"
- "threadedlistmodel/timedisplay.qml"
- "threading.qml"
- "workerscript/Spinner.qml"
- "workerscript/workerscript.mjs"
- "workerscript/workerscript.qml"
-)
-
-qt6_add_resources(threading "threading"
- PREFIX
- "/threading"
- FILES
- ${threading_resource_files}
-)
-set(shared_resource_files
- "../shared/Button.qml"
- "../shared/CheckBox.qml"
- "../shared/FlickrRssModel.qml"
- "../shared/Label.qml"
- "../shared/LauncherList.qml"
- "../shared/SimpleLauncherDelegate.qml"
- "../shared/Slider.qml"
- "../shared/TabSet.qml"
- "../shared/TextField.qml"
- "../shared/images/back.png"
- "../shared/images/checkmark.png"
- "../shared/images/next.png"
- "../shared/images/qt-logo.png"
- "../shared/images/slider_handle.png"
- "../shared/images/tab.png"
-)
-
-qt6_add_resources(threading "shared"
- PREFIX
- "/shared"
- BASE
- "../shared"
- FILES
- ${shared_resource_files}
+qt_add_qml_module(threadingexample
+ URI threading
+ VERSION 1.0
+ QML_FILES
+ "threadedlistmodel/dataloader.mjs"
+ "threadedlistmodel/timedisplay.qml"
+ "threading.qml"
+ "workerscript/Spinner.qml"
+ "workerscript/workerscript.mjs"
+ "workerscript/workerscript.qml"
)
-install(TARGETS threading
+install(TARGETS threadingexample
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
+bundle_shared(threadingexample)