C
Qt Quick Ultralite swipe_game Demo
# Copyright (C) 2026 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial
cmake_minimum_required(VERSION 3.21.1)
project(swipe_game VERSION 0.0.1 LANGUAGES C CXX ASM)
find_package(QulApp)
add_subdirectory(StyleModule)
add_subdirectory(SwipeModule)
if(QUL_PLATFORM MATCHES "autosar")
qul_add_library(swipe_game)
else()
qul_add_executable(swipe_game)
endif()
set(SWIPE_GAME_IMAGES
images/mask_circle.svg
images/mask_circle_highlight.svg
images/mask_circle_highlight_right.svg
images/mask_circle_highlight_small_right.svg
images/timebar.svg
)
set_source_files_properties(images/mask_circle.svg images/mask_circle_highlight.svg PROPERTIES
QUL_RESOURCE_OPTIMIZE_FOR_ROTATION OFF
)
set_source_files_properties(
images/mask_circle_highlight.svg
images/mask_circle_highlight_right.svg
images/mask_circle_highlight_small_right.svg
images/timebar.svg
PROPERTIES
QUL_RESOURCE_CACHE_POLICY "OnDemand"
QUL_RESOURCE_SPLIT_IMAGE_OPTIMIZATION OFF
)
set_source_files_properties(images/mask_circle_highlight_right.svg PROPERTIES
QUL_RESOURCE_IMAGE_PIXEL_FORMAT "Alpha8"
)
if(QUL_PLATFORM MATCHES "^ek-ra8d1")
set_source_files_properties(${SWIPE_GAME_IMAGES} PROPERTIES
QUL_RESOURCE_STORAGE_SECTION "QulResourceDataInExternalFlash"
)
endif()
qul_add_qml_module(swipe_game
URI SwipeGameApp
QML_FILES
SwipeGame.qml
BaseView.qml
Button.qml
CircularSwipeArea.qml
ConfigContainer.qml
ConfigView.qml
DirectionalSwipeArea.qml
GameContainer.qml
GameOverView.qml
GameRunningView.qml
GameStartView.qml
HighscoreView.qml
LabeledSwitch.qml
NumberView.qml
ScrollIndicator.qml
StartView.qml
TimeView.qml
SOURCES
Globals.cpp
Globals.h
HighscoreModel.cpp
HighscoreModel.h
RESOURCES
${SWIPE_GAME_IMAGES}
NO_SBOM
)
target_link_libraries(swipe_game PRIVATE swipe_game_style_module swipe_game_swipe_module)
# App-wide defaults; individual images override these above where noted.
set_target_properties(swipe_game PROPERTIES
QUL_GLYPHS_RESOURCE_CACHE_POLICY "NoCaching"
QUL_RESOURCE_OPTIMIZE_FOR_ROTATION ON
QUL_RESOURCE_OPTIMIZE_FOR_SCALE ON
)
if(QUL_PLATFORM MATCHES "^ek-ra8d1")
set_target_properties(swipe_game PROPERTIES
QUL_DISPLAY_ROTATION_ANGLE 90
QUL_SHOW_DESKTOP_PREVIEW_IN_NATURAL_DISPLAY_ORIENTATION false
)
qul_set_maximum_resource_cache_size(swipe_game CACHE_SIZE 2048576)
else()
qul_set_maximum_resource_cache_size(swipe_game CACHE_SIZE 1048576)
endif()
app_target_default_entrypoint(swipe_game SwipeGame MODULE SwipeGameApp)
if (QUL_OS STREQUAL "FreeRTOS" AND NOT (QUL_PLATFORM MATCHES "^stm32f769i" OR QUL_PLATFORM MATCHES "^mimxrt10"))
math(EXPR cache_size_in_bytes "1024 * 1024")
if (QUL_PLATFORM STREQUAL "mimxrt1170-evkb-freertos")
# NXP 1170 needs additional 2*3.6MB for the screen layer
qul_override_freertos_heap_size(swipe_game "8 * 1024 * 1024 + ${cache_size_in_bytes}")
else()
qul_override_freertos_heap_size(swipe_game "1024 * 1024 + ${cache_size_in_bytes}")
endif()
endif()
app_target_setup_os(swipe_game)