C

Qt Quick Ultralite styling Example

cmake_minimum_required (VERSION 3.15)

project(styling VERSION 0.0.1 LANGUAGES C CXX ASM ASM_MASM)
if (NOT TARGET Qul::Core)
    find_package(Qul)
endif()

#
# Default style version: link Qul::Controls
#
qul_add_target(styling_default)
qul_target_qml_sources(styling_default styling.qml)
target_link_libraries(styling_default PRIVATE Qul::Controls
)
app_target_setup_os(styling_default)
app_target_default_entrypoint(styling_default styling)

#
# Custom style version
#
# The custom style is in the styles/custom directory and provides a
# CustomStyleLib target that is linked inplace of the default style
# library.
#
# Setting the QUL_CONTROLS_STYLE target property makes the custom
# style available as the QtQuick.Controls QML import.
#
qul_add_target(styling_custom)
add_subdirectory(styles/custom)
qul_target_qml_sources(styling_custom styling.qml)
set_property(TARGET styling_custom PROPERTY QUL_CONTROLS_STYLE CustomControls)
target_link_libraries(styling_custom PRIVATE CustomStyleLib
)
app_target_setup_os(styling_custom)
app_target_default_entrypoint(styling_custom styling)