C

Qt Quick Ultralite traveo_t2g_effects Example

# Copyright (C) 2025 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial
set(QUL_TVIIC_PLATFORM OFF)
if("${QUL_PLATFORM}" MATCHES "tviic.*")
    set(QUL_TVIIC_PLATFORM ON)
endif()

if(QUL_TVIIC_PLATFORM)
    list(APPEND CMAKE_MODULE_PATH ${QUL_PLATFORM_TARGET_DIR}/../common/cmake/modules)
    # Old path needed for platform compatibility checks after UL-5159 (renamed folder from tvii-shared to common)
    list(APPEND CMAKE_MODULE_PATH ${QUL_PLATFORM_TARGET_DIR}/../tvii-shared/cmake/modules)
    if (NOT ARMGCC)
        find_package(TVII-SDK REQUIRED COMPONENTS basic_graphics util)
        message(STATUS "TRAVEO™ T2G include dirs = ${TVII_SDK_INCLUDE_DIRS}")
    endif()
else()
    message(STATUS "NOT CROSS COMPILING")

    find_package(Qt6 6.2 COMPONENTS Core Gui Widgets REQUIRED)

    if(CMAKE_HOST_WIN32)
      set(QUL_INSTALLED_QT_PACKAGE Qt6Bundle)
    else()
      set(QUL_INSTALLED_QT_PACKAGE Qt6)
    endif()

endif()

qul_add_qml_module(traveo_t2g_effects_effects_module
    URI TviiEffects
    QML_FILES
        Desaturation.qml
        GaussianBlur.qml
        ImageWithOpacityMask.qml
        NeedleTrail.qml
    SOURCES
        desaturationdelegate.cpp
        desaturationdelegate.h
        gaussianblurdelegate.cpp
        gaussianblurdelegate.h
        imagewithopacitymaskdelegate.cpp
        imagewithopacitymaskdelegate.h
        needletraildelegate.cpp
        needletraildelegate.h
    NO_SBOM
)
set(effects_module traveo_t2g_effects_effects_module)

target_link_libraries(${effects_module} PUBLIC Qul::PlatformBSPConfig)

if(QUL_TVIIC_PLATFORM)
    target_include_directories(${effects_module}
        PUBLIC ${TVII_SDK_INCLUDE_DIRS}
    )

    target_compile_definitions(${effects_module}
        PUBLIC QUL_TVIIC_PLATFORM
    )
    target_sources(${effects_module}
        PRIVATE cygfx.cpp
    )
else()
    target_link_libraries(${effects_module}
        PRIVATE Qt6::Gui Qt6::Widgets
    )
endif()