summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/shared
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk@kdab.com>2019-06-04 17:08:47 +0200
committerKevin Funk <kevin.funk@kdab.com>2019-06-05 12:53:28 +0000
commit99539a289491a2a709c2a63cd91eac155a1699da (patch)
treed928d6c6e123c6588261bea9358354fe1e1a7400 /examples/widgets/painting/shared
parentace549587073d387823815b02ec85a28da408844 (diff)
Allow to build examples as standalone project
Create CMake config files which can be used from the very same CMake project. These CMake config files simply do not create any targets, controlled via the QT_NO_CREATE_TARGETS. This patch also allows to build qtbase.git:examples as a standalone project, against an already-built Qt. Ran this: ag -s "QT " examples -l -0 | xargs -0 -n 1 .../util/cmake/pro2cmake.py --is-example Task-number: QTBUG-74713 Change-Id: I44cce5a4048618b30f890c5b789592c227a8b47d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/widgets/painting/shared')
-rw-r--r--examples/widgets/painting/shared/CMakeLists.txt53
1 files changed, 8 insertions, 45 deletions
diff --git a/examples/widgets/painting/shared/CMakeLists.txt b/examples/widgets/painting/shared/CMakeLists.txt
index a7bec2789b..c94a586425 100644
--- a/examples/widgets/painting/shared/CMakeLists.txt
+++ b/examples/widgets/painting/shared/CMakeLists.txt
@@ -2,7 +2,7 @@
# special case:
add_library(painting_shared OBJECT)
-qt_manual_moc(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/
+qt5_wrap_cpp(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/
target_sources(painting_shared PRIVATE
arthurstyle.cpp arthurstyle.h
arthurwidgets.cpp arthurwidgets.h
@@ -12,53 +12,16 @@ target_sources(painting_shared PRIVATE
target_link_libraries(painting_shared PUBLIC Qt::Widgets)
target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
-
-# Resources:
-add_qt_resource(painting_shared "shared" PREFIX "/res" FILES
- images/button_normal_cap_left.png
- images/button_normal_cap_right.png
- images/button_normal_stretch.png
- images/button_pressed_cap_left.png
- images/button_pressed_cap_right.png
- images/button_pressed_stretch.png
- images/frame_bottom.png
- images/frame_bottomleft.png
- images/frame_bottomright.png
- images/frame_left.png
- images/frame_right.png
- images/frame_top.png
- images/frame_topleft.png
- images/frame_topright.png
- images/groupframe_bottom_left.png
- images/groupframe_bottom_right.png
- images/groupframe_bottom_stretch.png
- images/groupframe_left_stretch.png
- images/groupframe_right_stretch.png
- images/groupframe_top_stretch.png
- images/groupframe_topleft.png
- images/groupframe_topright.png
- images/line_dash_dot.png
- images/line_dash_dot_dot.png
- images/line_dashed.png
- images/line_dotted.png
- images/line_solid.png
- images/radiobutton-on.png
- images/radiobutton_off.png
- images/radiobutton_on.png
- images/slider_bar.png
- images/slider_thumb_on.png
- images/title_cap_left.png
- images/title_cap_right.png
- images/title_stretch.png)
-
+qt5_add_resources(res_files shared.qrc)
+target_sources(painting_shared PRIVATE ${res_files})
## Scopes:
#####################################################################
-extend_target(painting_shared CONDITION TARGET Qt::OpenGL OR QT_FEATURE_opengles2
- DEFINES
- QT_OPENGL_SUPPORT
- LIBRARIES
+if (TARGET Qt::OpenGL OR QT_FEATURE_opengles2)
+ target_compile_definitions(painting_shared PRIVATE QT_OPENGL_SUPPORT)
+ target_link_libraries(painting_shared PRIVATE
Qt::OpenGL
Qt::Widgets
-)
+ )
+endif()