qt5base-lts/examples/widgets/tools/undoframework/CMakeLists.txt
Volker Hilsheimer cb0bf5ad68 Merge "undo" and "undoframework" examples
The "undo" example didn't show anything that the "undoframework"
example doesn't, and the latter is more comprehensive and properly
documented. "undoframework" also uses QGraphicsView instead of
inventing its own diagram widget.

However, the "undo" example created a nicer UI with toolbuttons,
icons, and the undo view in a dock widget, so reuse those elements
in the "undoframework" example instead.

Update the documentation quoting tags accordingly, and clean up
a bit.

Pick-to: 6.5
Change-Id: I3c91feecbd5fe3e5900838b0b51f9fe7bd190280
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-01-31 00:20:31 +01:00

58 lines
1.2 KiB
CMake

# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(undoframework LANGUAGES CXX)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/undoframework")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_standard_project_setup()
qt_add_executable(undoframework
commands.cpp commands.h
diagramitem.cpp diagramitem.h
diagramscene.cpp diagramscene.h
main.cpp
mainwindow.cpp mainwindow.h
)
set_target_properties(undoframework PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
target_link_libraries(undoframework PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
)
# Resources:
set(undoframework_resource_files
"icons/cross.png"
"icons/rectangle.png"
"icons/redo.png"
"icons/remove.png"
"icons/triangle.png"
"icons/undo.png"
)
qt_add_resources(undoframework "undoframework"
PREFIX
"/"
FILES
${undoframework_resource_files}
)
install(TARGETS undoframework
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)