1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(gallery_controls2 LANGUAGES CXX)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick QuickControls2)
qt_standard_project_setup(REQUIRES 6.8)
qt_add_executable(galleryexample WIN32 MACOSX_BUNDLE
gallery.cpp
)
qt_add_qml_module(galleryexample
URI gallery
NO_RESOURCE_TARGET_PATH
QML_FILES
"+Material/ToolBar.qml"
"ToolBar.qml"
"gallery.qml"
"pages/BusyIndicatorPage.qml"
"pages/ButtonPage.qml"
"pages/CheckBoxPage.qml"
"pages/ComboBoxPage.qml"
"pages/DelayButtonPage.qml"
"pages/DelegatePage.qml"
"pages/DialPage.qml"
"pages/DialogPage.qml"
"pages/FramePage.qml"
"pages/GroupBoxPage.qml"
"pages/PageIndicatorPage.qml"
"pages/ProgressBarPage.qml"
"pages/RadioButtonPage.qml"
"pages/RangeSliderPage.qml"
"pages/ScrollBarPage.qml"
"pages/ScrollIndicatorPage.qml"
"pages/ScrollablePage.qml"
"pages/SliderPage.qml"
"pages/SpinBoxPage.qml"
"pages/StackViewPage.qml"
"pages/SwipeViewPage.qml"
"pages/SwitchPage.qml"
"pages/TabBarPage.qml"
"pages/TextAreaPage.qml"
"pages/TextFieldPage.qml"
"pages/ToolTipPage.qml"
"pages/TumblerPage.qml"
RESOURCES
"icons/gallery/20x20/back.png"
"icons/gallery/20x20/drawer.png"
"icons/gallery/20x20/menu.png"
"icons/gallery/20x20@2/back.png"
"icons/gallery/20x20@2/drawer.png"
"icons/gallery/20x20@2/menu.png"
"icons/gallery/20x20@3/back.png"
"icons/gallery/20x20@3/drawer.png"
"icons/gallery/20x20@3/menu.png"
"icons/gallery/20x20@4/back.png"
"icons/gallery/20x20@4/drawer.png"
"icons/gallery/20x20@4/menu.png"
"icons/gallery/index.theme"
"images/arrow.png"
"images/arrow@2x.png"
"images/arrow@3x.png"
"images/arrow@4x.png"
"images/arrows.png"
"images/arrows@2x.png"
"images/arrows@3x.png"
"images/arrows@4x.png"
"images/qt-logo.png"
"images/qt-logo@2x.png"
"images/qt-logo@3x.png"
"images/qt-logo@4x.png"
"qtquickcontrols2.conf"
)
target_link_libraries(galleryexample PUBLIC
Qt6::Core
Qt6::Gui
Qt6::Quick
Qt6::QuickControls2
)
if(UNIX AND NOT APPLE AND CMAKE_CROSSCOMPILING)
find_package(Qt6 REQUIRED COMPONENTS QuickTemplates2)
# Work around QTBUG-86533
target_link_libraries(galleryexample PRIVATE Qt6::QuickTemplates2)
endif()
install(TARGETS galleryexample
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
qt_generate_deploy_qml_app_script(
TARGET galleryexample
OUTPUT_SCRIPT deploy_script
MACOS_BUNDLE_POST_BUILD
NO_UNSUPPORTED_PLATFORM_ERROR
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
)
install(SCRIPT ${deploy_script})
|