C

Qt Quick Ultralite styling Example

cmake_minimum_required (VERSION 3.15)

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

#
# Default style version: link Qul::QuickUltraliteControlsStyleDefault
#
add_executable(styling_default)
qul_target_qml_sources(styling_default styling.qml)
target_link_libraries(styling_default Qul::QuickUltralite
                                      Qul::QuickUltralitePlatform
                                      Qul::QuickUltraliteControlsStyleDefault
)
app_target_setup_os(styling_default)
app_target_default_main(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.
#
add_executable(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 Qul::QuickUltralite
                                     Qul::QuickUltralitePlatform
                                     CustomStyleLib
)
app_target_setup_os(styling_custom)
app_target_default_main(styling_custom styling)