aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/keyinteraction/CMakeLists.txt
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2021-11-08 14:59:43 +0100
committerOliver Eftevaag <oliver.eftevaag@qt.io>2021-11-11 12:11:40 +0100
commit750e7d946ca8c059151e91c57da243bdc787ea6e (patch)
treef335f1ee81989a9cdb0d73b3372c55be51e1c734 /examples/quick/keyinteraction/CMakeLists.txt
parent28bfd773cac84d228df9e6bdcc9bed84d79935c5 (diff)
Keyinteraction example: use qt_add_qml_module() in CMakeLists.txt
We want to use the new cmake api instead of qt6_add_resources() The file structure has also been flattened a bit. Task-number: QTBUG-98130 Pick-to: 6.2 Change-Id: I1651d25e2902bf6932b78c2224ee4ffe454b658d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/quick/keyinteraction/CMakeLists.txt')
-rw-r--r--examples/quick/keyinteraction/CMakeLists.txt51
1 files changed, 18 insertions, 33 deletions
diff --git a/examples/quick/keyinteraction/CMakeLists.txt b/examples/quick/keyinteraction/CMakeLists.txt
index ffb8c8924a..e338c11024 100644
--- a/examples/quick/keyinteraction/CMakeLists.txt
+++ b/examples/quick/keyinteraction/CMakeLists.txt
@@ -1,13 +1,9 @@
-# Generated from keyinteraction.pro.
-
cmake_minimum_required(VERSION 3.16)
project(keyinteraction LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
@@ -15,47 +11,36 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/keyinteraction")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Quick)
-find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 COMPONENTS Core Gui Quick Qml)
-qt_add_executable(keyinteraction
+qt_add_executable(keyinteractionexample WIN32 MACOSX_BUNDLE
main.cpp
)
-set_target_properties(keyinteraction PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(keyinteraction PUBLIC
+target_link_libraries(keyinteractionexample PRIVATE
Qt::Core
Qt::Gui
Qt::Qml
Qt::Quick
)
-
# Resources:
-set(keyinteraction_resource_files
- "focus/Core/ContextMenu.qml"
- "focus/Core/GridMenu.qml"
- "focus/Core/ListMenu.qml"
- "focus/Core/ListViewDelegate.qml"
- "focus/Core/TabMenu.qml"
- "focus/Core/images/arrow.png"
- "focus/Core/images/qt-logo.png"
- "focus/focus.qml"
- "keyinteraction.qml"
-)
-
-qt6_add_resources(keyinteraction "keyinteraction"
- PREFIX
- "/keyinteraction"
- FILES
- ${keyinteraction_resource_files}
+qt_add_qml_module(keyinteractionexample
+ URI keyinteraction
+ VERSION 1.0
+ QML_FILES
+ "ContextMenu.qml"
+ "GridMenu.qml"
+ "ListMenu.qml"
+ "ListViewDelegate.qml"
+ "TabMenu.qml"
+ "focus.qml"
+ "keyinteraction.qml"
+ RESOURCES
+ "images/arrow.png"
+ "images/qt-logo.png"
)
-install(TARGETS keyinteraction
+install(TARGETS keyinteractionexample
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"