C

Qt Quick Ultralite tvii_effects Example

set(QUL_TVIIC_PLATFORM OFF)
if("${QUL_PLATFORM}" MATCHES "tviic.*")
    set(QUL_TVIIC_PLATFORM ON)
endif()

if (NOT TARGET Qul::QuickUltralite)
    find_package(Qul)
endif()

qul_add_qml_module(tvii_effects_module
    URI TviiEffects
    QML_FILES
        Desaturation.qml
        GaussianBlur.qml
        ImageWithOpacityMask.qml
        NeedleTrail.qml
    SOURCES
        desaturation.cpp
        gaussianblur.cpp
        imagewithopacitymask.cpp
        needletrail.cpp
    HEADERS
        desaturation.h
        gaussianblur.h
        imagewithopacitymask.h
        needletrail.h
    OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/modules
)

if(QUL_TVIIC_PLATFORM)
    list(APPEND CMAKE_MODULE_PATH ${TARGET_PLATFORM_DIR}/../tvii-shared/cmake/modules)
    find_package(TVII-SDK REQUIRED EXACT ${REQUIRED_SDK_VERSION} COMPONENTS sdl basic_graphics util mw freetype)

    message(STATUS "TVII include dirs = ${TVII_SDK_INCLUDE_DIRS}")

    target_include_directories(tvii_effects_module PUBLIC
        ${TVII_SDK_INCLUDE_DIRS}
    )

    target_compile_definitions(tvii_effects_module PUBLIC QUL_TVIIC_PLATFORM)
    target_sources(tvii_effects_module PRIVATE cygfx.cpp)
else()
    message(STATUS "NOT CROSS COMPILING")

    find_package(Qt5 5.15 COMPONENTS ${QUL_QT_COMPONENTS} REQUIRED)

    if(CMAKE_HOST_WIN32)
      set(QUL_INSTALLED_QT_PACKAGE Qt5Bundle)
    else()
      set(QUL_INSTALLED_QT_PACKAGE Qt5)
    endif()

    target_link_libraries(tvii_effects_module Qt5::Gui Qt5::Widgets)
endif()