2022-07-05 12:02:29 +00:00
|
|
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2024-03-07 14:22:17 +00:00
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2022-07-05 12:02:29 +00:00
|
|
|
|
2021-09-06 19:40:18 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(pointerhandlers LANGUAGES CXX)
|
|
|
|
|
2022-01-20 16:42:48 +00:00
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Svg)
|
2021-09-06 19:40:18 +00:00
|
|
|
|
2023-02-02 15:44:55 +00:00
|
|
|
qt_standard_project_setup(REQUIRES 6.5)
|
2023-01-11 08:38:15 +00:00
|
|
|
|
2021-09-06 19:40:18 +00:00
|
|
|
add_subdirectory("../shared" "shared")
|
|
|
|
|
|
|
|
qt_add_executable(pointerhandlersexample WIN32 MACOSX_BUNDLE main.cpp)
|
|
|
|
|
2023-01-11 08:38:15 +00:00
|
|
|
target_link_libraries(pointerhandlersexample PRIVATE
|
2023-04-28 11:21:38 +00:00
|
|
|
Qt6::Core
|
|
|
|
Qt6::Gui
|
|
|
|
Qt6::Qml
|
|
|
|
Qt6::Quick
|
|
|
|
Qt6::Svg
|
2021-09-06 19:40:18 +00:00
|
|
|
)
|
|
|
|
|
2021-10-26 09:47:52 +00:00
|
|
|
add_dependencies(pointerhandlersexample pointerhandlers_shared)
|
|
|
|
|
2021-09-06 19:40:18 +00:00
|
|
|
qt_add_qml_module(pointerhandlersexample
|
|
|
|
URI pointerhandlers
|
|
|
|
QML_FILES
|
|
|
|
"components/Button.qml"
|
|
|
|
"components/CheckBox.qml"
|
2023-06-29 10:51:23 +00:00
|
|
|
"components/CorkPanel.qml"
|
2021-09-06 19:40:18 +00:00
|
|
|
"components/FakeFlickable.qml"
|
|
|
|
"components/FlashAnimation.qml"
|
|
|
|
"components/LeftDrawer.qml"
|
|
|
|
"components/MomentumAnimation.qml"
|
|
|
|
"components/MouseFeedbackSprite.qml"
|
2021-12-08 16:33:19 +00:00
|
|
|
"components/QuadPieMenu.qml"
|
2021-09-06 19:40:18 +00:00
|
|
|
"components/ScrollBar.qml"
|
|
|
|
"components/Slider.qml"
|
|
|
|
"components/TouchpointFeedbackSprite.qml"
|
2023-06-29 10:51:23 +00:00
|
|
|
"corkboards.qml"
|
2021-09-06 19:40:18 +00:00
|
|
|
"fakeFlickable.qml"
|
|
|
|
"flingAnimation.qml"
|
|
|
|
"joystick.qml"
|
|
|
|
"map.qml"
|
|
|
|
"mixer.qml"
|
|
|
|
"multibuttons.qml"
|
2023-06-29 10:51:23 +00:00
|
|
|
"multiflame.qml"
|
2021-12-08 16:33:19 +00:00
|
|
|
"pieMenu.qml"
|
2021-09-06 19:40:18 +00:00
|
|
|
"pinchHandler.qml"
|
|
|
|
"pointerhandlers.qml"
|
|
|
|
"sidebar.qml"
|
|
|
|
"singlePointHandlerProperties.qml"
|
|
|
|
"tabletCanvasDrawing.qml"
|
|
|
|
"tapHandler.qml"
|
|
|
|
RESOURCES
|
|
|
|
"components/images/checkmark.png"
|
2023-06-29 10:51:23 +00:00
|
|
|
"components/images/cork.jpg"
|
2021-09-06 19:40:18 +00:00
|
|
|
"components/images/fingersprite.png"
|
|
|
|
"components/images/mixer-knob.png"
|
|
|
|
"components/images/mouse.png"
|
|
|
|
"components/images/mouse_left.png"
|
|
|
|
"components/images/mouse_middle.png"
|
|
|
|
"components/images/mouse_right.png"
|
2020-05-06 20:37:33 +00:00
|
|
|
"components/images/mouse_wheel_ridges.png"
|
2023-06-29 10:51:23 +00:00
|
|
|
"components/images/note-yellow.png"
|
|
|
|
"components/images/tack.png"
|
2021-09-06 19:40:18 +00:00
|
|
|
"images/arrowhead.png"
|
|
|
|
"images/balloon.png"
|
2023-06-29 10:51:23 +00:00
|
|
|
"images/blur-circle.png"
|
2021-09-06 19:40:18 +00:00
|
|
|
"images/cursor-airbrush.png"
|
|
|
|
"images/cursor-eraser.png"
|
|
|
|
"images/cursor-felt-marker.png"
|
|
|
|
"images/cursor-pencil.png"
|
|
|
|
"images/fighter.png"
|
|
|
|
"images/grabbing-location.svg"
|
|
|
|
"images/joystick-outer-case-pov.jpg"
|
|
|
|
"images/map.svgz"
|
|
|
|
"images/missile.png"
|
|
|
|
"images/redball.png"
|
|
|
|
)
|
|
|
|
|
|
|
|
install(TARGETS pointerhandlersexample
|
CMake: Add deployment API to our examples
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor
A few examples had to be adapted manually, mostly those that build
additional qml modules / plugins.
The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were
removed, these are not needed anymore because example directory
selection is handled by the qt_internal_add_example calls.
The install(TARGETS) calls were modified according to our
documentation snippets for qt_generate_deploy_qml_app_script.
A qt_generate_deploy_qml_app_script call was added for each
executable target.
Note that the deployment step will be skipped in the CI for now,
because:
- we enable QT_DEPLOY_MINIMAL_EXAMPLES in the CI instructions and thus
set QT_INTERNAL_SKIP_DEPLOYMENT to true
- standalone examples feature is not yet enabled in the CI, which
means we continue to build examples in-tree, and deployment is
disabled for in-tree prefix builds.
A small list of examples to deploy in the CI will be chosen in the
future, to ensure deployment coverage, without slowing down overall CI
times due to all the *deployqt invocations.
Even if deployment is disabled in the CI, the install(TARGETS) calls
for each example will still run, installing into an
'installed_examples' directory, which will not be archived by the CI.
The QtBundleQmlModuleForMacOS and bundle_shared code was removed,
because we can now depend on the MACOS_BUNDLE_POST_BUILD option of the
deployment api, to ensure macOS bundle examples run properly in the
build dir. This works even in prefix in-tree builds, when installation
deployment is disabled.
Finally, for all examples that build additional qml module libraries or
plugins, the libraries / plugins must be installed into the bin dir of
each project, along with a qmldir file.
This is to support running the installed project for platforms that
don't have deployment api yet, like boot2qt / yocto.
If we want to have super clean install / deployment rules in the
future, we won't be able to avoid adding ugly per-platform conditions.
The current status quo is deemed an improvement over what we had
before.
Pick-to: 6.7
Task-number: QTBUG-101340
Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: I843d934668c25dbcd1abca52495b393579633fc5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 18:03:03 +00:00
|
|
|
BUNDLE DESTINATION .
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
2021-09-06 19:40:18 +00:00
|
|
|
)
|
2022-01-20 16:42:48 +00:00
|
|
|
|
CMake: Add deployment API to our examples
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor
A few examples had to be adapted manually, mostly those that build
additional qml modules / plugins.
The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were
removed, these are not needed anymore because example directory
selection is handled by the qt_internal_add_example calls.
The install(TARGETS) calls were modified according to our
documentation snippets for qt_generate_deploy_qml_app_script.
A qt_generate_deploy_qml_app_script call was added for each
executable target.
Note that the deployment step will be skipped in the CI for now,
because:
- we enable QT_DEPLOY_MINIMAL_EXAMPLES in the CI instructions and thus
set QT_INTERNAL_SKIP_DEPLOYMENT to true
- standalone examples feature is not yet enabled in the CI, which
means we continue to build examples in-tree, and deployment is
disabled for in-tree prefix builds.
A small list of examples to deploy in the CI will be chosen in the
future, to ensure deployment coverage, without slowing down overall CI
times due to all the *deployqt invocations.
Even if deployment is disabled in the CI, the install(TARGETS) calls
for each example will still run, installing into an
'installed_examples' directory, which will not be archived by the CI.
The QtBundleQmlModuleForMacOS and bundle_shared code was removed,
because we can now depend on the MACOS_BUNDLE_POST_BUILD option of the
deployment api, to ensure macOS bundle examples run properly in the
build dir. This works even in prefix in-tree builds, when installation
deployment is disabled.
Finally, for all examples that build additional qml module libraries or
plugins, the libraries / plugins must be installed into the bin dir of
each project, along with a qmldir file.
This is to support running the installed project for platforms that
don't have deployment api yet, like boot2qt / yocto.
If we want to have super clean install / deployment rules in the
future, we won't be able to avoid adding ugly per-platform conditions.
The current status quo is deemed an improvement over what we had
before.
Pick-to: 6.7
Task-number: QTBUG-101340
Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: I843d934668c25dbcd1abca52495b393579633fc5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 18:03:03 +00:00
|
|
|
qt_generate_deploy_qml_app_script(
|
|
|
|
TARGET pointerhandlersexample
|
|
|
|
OUTPUT_SCRIPT deploy_script
|
|
|
|
MACOS_BUNDLE_POST_BUILD
|
|
|
|
NO_UNSUPPORTED_PLATFORM_ERROR
|
|
|
|
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
|
|
|
|
)
|
|
|
|
install(SCRIPT ${deploy_script})
|