C

Qt Quick Ultralite freertos_multitask Example

cmake_minimum_required (VERSION 3.17.3)

project(freertos_multitask VERSION 0.0.1 LANGUAGES C CXX ASM)
if (NOT TARGET Qul::QuickUltralite)
    find_package(Qul)
endif()

add_subdirectory(freertos)

if(TARGET freertos_kernel) # FreeRTOS support implemented for this platform
    add_subdirectory(board_utils)

    qul_add_target(freertos_multitask
         src/main.cpp
         src/fancontrol.cpp
    )
    qul_target_generate_interfaces(freertos_multitask
        ${CMAKE_CURRENT_SOURCE_DIR}/src/fancontrol.h
    )
    qul_add_resource(freertos_multitask
        FILES
            images/background-dark.png
            images/fan-off.png
    )

    qul_target_qml_sources(freertos_multitask freertos_multitask.qml)
    target_link_libraries(freertos_multitask freertos_kernel board_utils)

elseif(NOT CMAKE_CROSSCOMPILING) # No FreeRTOS here - fallback for building on desktop platform
    qul_add_target(freertos_multitask_desktop src/fancontrol.cpp)
    qul_add_resource(freertos_multitask_desktop
        FILES
            images/background-dark.png
            images/fan-off.png
    )
    qul_target_qml_sources(freertos_multitask_desktop freertos_multitask.qml)
    qul_target_generate_interfaces(freertos_multitask_desktop
        ${CMAKE_CURRENT_SOURCE_DIR}/src/fancontrol.h
    )
    target_compile_definitions(freertos_multitask_desktop PRIVATE NO_LED)

    app_target_default_entrypoint(freertos_multitask_desktop freertos_multitask)

else()
    message(STATUS "Skipping generating target: freertos_multitask")
endif()