| 1 |
# Copyright (C) 2022 The Qt Company Ltd. |
| 2 |
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause |
| 3 |
|
| 4 |
cmake_minimum_required(VERSION 3.16) |
| 5 |
project(pinchzoom LANGUAGES CXX) |
| 6 |
|
| 7 |
if(NOT DEFINED INSTALL_EXAMPLESDIR) |
| 8 |
set(INSTALL_EXAMPLESDIR "examples") |
| 9 |
endif() |
| 10 |
|
| 11 |
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/touch/pinchzoom") |
| 12 |
|
| 13 |
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) |
| 14 |
|
| 15 |
qt_standard_project_setup() |
| 16 |
|
| 17 |
qt_add_executable(pinchzoom |
| 18 |
graphicsview.cpp graphicsview.h |
| 19 |
main.cpp |
| 20 |
mouse.cpp mouse.h |
| 21 |
) |
| 22 |
|
| 23 |
set_target_properties(pinchzoom PROPERTIES |
| 24 |
WIN32_EXECUTABLE TRUE |
| 25 |
MACOSX_BUNDLE TRUE |
| 26 |
) |
| 27 |
|
| 28 |
target_link_libraries(pinchzoom PRIVATE |
| 29 |
Qt6::Core |
| 30 |
Qt6::Gui |
| 31 |
Qt6::Widgets |
| 32 |
) |
| 33 |
|
| 34 |
# Resources: |
| 35 |
set(mice_resource_files |
| 36 |
"images/cheese.jpg" |
| 37 |
) |
| 38 |
|
| 39 |
qt_add_resources(pinchzoom "mice" |
| 40 |
PREFIX |
| 41 |
"/" |
| 42 |
FILES |
| 43 |
${mice_resource_files} |
| 44 |
) |
| 45 |
|
| 46 |
install(TARGETS pinchzoom |
| 47 |
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" |
| 48 |
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" |
| 49 |
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" |
| 50 |
) |