C

Qt Quick Ultralite Watch Demo

cmake_minimum_required (VERSION 3.12)
project(watch VERSION 0.0.1 LANGUAGES CXX)

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

set(QUL_FONTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fonts")
set(QUL_DEFAULT_FONT_FAMILY "Montserrat")

add_executable(watch
    src/WatchModel.cpp
    src/HealthModel.cpp
)

qul_target_generate_interfaces(watch ${CMAKE_CURRENT_SOURCE_DIR}/inc/WatchModel.h
    OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
qul_target_generate_interfaces(watch ${CMAKE_CURRENT_SOURCE_DIR}/inc/HealthModel.h
    OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

target_include_directories(watch PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc
                                        ${CMAKE_CURRENT_BINARY_DIR})

set(COMMON_QML_FILES
    watch.qml
    WatchShield.qml
    WeatherWidget.qml
    HealthWidget.qml
    WidgetsRow.qml
    ApplicationList.qml
    CompassWidget.qml
)
set(MODULE_QML_FILES
    imports/Watch/Theme.qml
    imports/Watch/MainModel.qml
)

set_source_files_properties(
    images/shield/hand-minute.png
    images/shield/hand-hour.png
    images/shield/hand-second.png
    images/compass/arrows.png
    PROPERTIES QUL_OPTIMIZE_FOR_ROTATION ON)

qul_add_resource(watch
    FILES
        images/compass/ring1.png
        images/compass/E.png
        images/compass/ring2.png
        images/compass/arrows.png
        images/compass/middleback.png
        images/compass/N.png
        images/compass/S.png
        images/compass/W.png
        images/weather/ion-ios-sunny-outline.png
        images/weather/w-bottom-mask.png
        images/weather/big-sun.png
        images/weather/ion-ios-partlysunny-outline.png
        images/weather/w-vertical.png
        images/weather/ion-ios-rainy-outline.png
        images/list/sport-app-big.png
        images/list/sport-app.png
        images/list/compass-big.png
        images/list/settings.png
        images/list/your-health-big.png
        images/list/settings-big.png
        images/list/compass.png
        images/list/tools.png
        images/list/your-health.png
        images/list/tools-big.png
        images/health/vertical-line.png
        images/health/graph.png
        images/health/graph-point.png
        images/health/horizontal-line.png
        images/health/heart.png
        images/shield/hand-minute.png
        images/shield/dots-all.png
        images/shield/battery.png
        images/shield/hands-middle-dot.png
        images/shield/steps.png
        images/shield/battery-icon.png
        images/shield/heart.png
        images/shield/small-oval-alt.png
        images/shield/hand-hour.png
        images/shield/steps-icon.png
        images/shield/hand-second.png
)

qul_target_qml_sources(watch ${COMMON_QML_FILES})

qul_add_qml_module(watch_module
    URI Watch
    QML_FILES
        ${MODULE_QML_FILES}
    OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/modules # avoid Watch/ and watch in the same dir
)

target_link_libraries(watch Qul::QuickUltralite Qul::QuickUltraliteControlsStyleDefault watch_module)
app_target_setup_os(watch)
app_target_default_main(watch watch)