C

Qt Quick Ultralite font_quality Example

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

project(font_quality VERSION 0.0.1 LANGUAGES C CXX ASM)

find_package(QulApp)

# Both variants share font_quality.qml and one module URI. The module is
# independent of the glyph generation setting, so it is built once and linked
# into both variants; QUL_AUTO_GENERATE_GLYPHS is set per variant on the
# application target, where glyph generation runs.
qul_add_qml_module(font_quality_module
    URI FontQualityApp
    QML_FILES font_quality.qml
)

function(add_font_quality_variant target auto_generate_glyphs)
    if(QUL_PLATFORM MATCHES "autosar")
        qul_add_library(${target})
    else()
        qul_add_executable(${target})
    endif()

    set_target_properties(${target} PROPERTIES
        QUL_DEFAULT_FONT_QUALITY "VeryLow"
        QUL_AUTO_GENERATE_GLYPHS ${auto_generate_glyphs}
    )

    target_link_libraries(${target} PRIVATE font_quality_module)

    app_target_setup_os(${target})
    app_target_default_entrypoint(${target} font_quality MODULE FontQualityApp)
endfunction()

add_font_quality_variant(font_quality OFF)
add_font_quality_variant(font_quality_all_glyphs ON)