summaryrefslogtreecommitdiffstats
path: root/examples/svg/richtext/textobject
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-03 17:26:03 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-10 13:37:53 +0100
commitc2ccbdd1eb5a367c2778caed091b25dddc895129 (patch)
tree261f3dded6dbe689b162cd839e41483e71ace331 /examples/svg/richtext/textobject
parentbded9220c97deac567817b3cff17594649ee904c (diff)
Add qtsvg examples to cmake
Note svggenerator is skipped because something is wrong with its generated cmake files that I didn't recognize. Pick-to: 6.1 Change-Id: I406fa45916148a10ae7b06e8853205d33011757f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/svg/richtext/textobject')
-rw-r--r--examples/svg/richtext/textobject/CMakeLists.txt56
1 files changed, 56 insertions, 0 deletions
diff --git a/examples/svg/richtext/textobject/CMakeLists.txt b/examples/svg/richtext/textobject/CMakeLists.txt
new file mode 100644
index 0000000..c79393b
--- /dev/null
+++ b/examples/svg/richtext/textobject/CMakeLists.txt
@@ -0,0 +1,56 @@
+# Generated from textobject.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(textobject LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/svg/richtext/textobject")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Svg)
+
+qt_add_executable(textobject
+ main.cpp
+ svgtextobject.cpp svgtextobject.h
+ window.cpp window.h
+)
+set_target_properties(textobject PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+target_link_libraries(textobject PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Svg
+ Qt::Widgets
+)
+
+
+# Resources:
+set(resources_resource_files
+ "files/heart.svg"
+)
+
+qt6_add_resources(textobject "resources"
+ PREFIX
+ "/"
+ FILES
+ ${resources_resource_files}
+)
+
+install(TARGETS textobject
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)