aboutsummaryrefslogtreecommitdiffstats
path: root/examples/demos/colorpaletteclient/QtExampleStyle/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/demos/colorpaletteclient/QtExampleStyle/CMakeLists.txt')
-rw-r--r--examples/demos/colorpaletteclient/QtExampleStyle/CMakeLists.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/examples/demos/colorpaletteclient/QtExampleStyle/CMakeLists.txt b/examples/demos/colorpaletteclient/QtExampleStyle/CMakeLists.txt
new file mode 100644
index 000000000..a911f8742
--- /dev/null
+++ b/examples/demos/colorpaletteclient/QtExampleStyle/CMakeLists.txt
@@ -0,0 +1,54 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(qtexamplestyle LANGUAGES CXX)
+
+set(CMAKE_AUTOMOC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols/colorpaletteclient/QtExampleStyle")
+
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick QuickControls2)
+
+set_source_files_properties(UIStyle.qml
+ PROPERTIES
+ QT_QML_SINGLETON_TYPE TRUE
+)
+
+qt_policy(SET QTP0001 NEW)
+qt_add_qml_module(qtexamplestyle
+ URI QtExampleStyle
+ PLUGIN_TARGET qtexamplestyle
+ QML_FILES
+ Button.qml
+ Popup.qml
+ UIStyle.qml
+ TextField.qml
+)
+
+target_link_libraries(qtexamplestyle 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(qtexamplestyle PRIVATE Qt6::QuickTemplates2)
+endif()
+
+install(TARGETS qtexamplestyle
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir
+ DESTINATION "${INSTALL_EXAMPLEDIR}"
+)