C

Qt Quick Ultralite traveo_t2g_effects Example

# Copyright (C) 2025 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial
cmake_minimum_required (VERSION 3.21.1)

project(traveo_t2g_effects VERSION 0.0.1 LANGUAGES C CXX ASM)

find_package(QulApp)

if(NOT QUL_PLATFORM MATCHES "^tviic2d")
    message(FATAL_ERROR "traveo_t2g_effects example is only supported on Infineon TRAVEO™ T2G boards")
endif()

add_subdirectory(TviiEffects)
add_subdirectory(Automotive)

if(QUL_PLATFORM MATCHES "autosar")
    qul_add_library(traveo_t2g_effects)
else()
    qul_add_executable(traveo_t2g_effects)
endif()

set_source_files_properties(
    images/needle-mask.png
    images/ak.png
    images/juno.png
    images/cover.jpg
    images/opacity-mask.png
    PROPERTIES
        QUL_RESOURCE_SPLIT_IMAGE_OPTIMIZATION FALSE
        QUL_RESOURCE_CACHE_POLICY "NoCaching"
)

# The needle image is used as a mask by the effects, so it must keep its own format instead
# of being optimized to Alpha8.
set_source_files_properties(images/needle-normal.png PROPERTIES
    QUL_PRIVATE_RESOURCE_OPTIMIZE_MONOCHROME_TO_ALPHA8 FALSE
    QUL_RESOURCE_SPLIT_IMAGE_OPTIMIZATION FALSE
)

set_source_files_properties(images/gauge-gauge-frame.png PROPERTIES
    QUL_RESOURCE_CACHE_POLICY "NoCaching"
)

qul_add_qml_module(traveo_t2g_effects
    URI TraveoT2gEffectsApp
    QML_FILES
        traveo_t2g_effects.qml
        Gauge.qml
        BaseGauge.qml
    RESOURCES
        images/needle-mask.png
        images/ak.png
        images/juno.png
        images/cover.jpg
        images/opacity-mask.png
        images/needle-normal.png
        images/gauge-gauge-frame.png
        images/highlight-normal.png
    NO_SBOM
)

if (QUL_OS_LOWERCASE STREQUAL "autosar")
    target_sources(traveo_t2g_effects PRIVATE qul_run.cpp)
else()
    target_sources(traveo_t2g_effects PRIVATE main.cpp)
endif()

target_link_libraries(traveo_t2g_effects PRIVATE
    traveo_t2g_effects_speed_module
    traveo_t2g_effects_effects_module
    Qul::PlatformTraveoIIExtras
)

app_target_setup_os(traveo_t2g_effects)