summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/shared/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/painting/shared/CMakeLists.txt')
-rw-r--r--examples/widgets/painting/shared/CMakeLists.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/examples/widgets/painting/shared/CMakeLists.txt b/examples/widgets/painting/shared/CMakeLists.txt
index 4c7049e01d..9d43e4a980 100644
--- a/examples/widgets/painting/shared/CMakeLists.txt
+++ b/examples/widgets/painting/shared/CMakeLists.txt
@@ -1,7 +1,16 @@
-# special case: Entire file!
+# special case skip regeneration
+# Port of shared.pri to be included by painting examples
+
+if(NOT TARGET Qt::Widgets)
+ find_package(Qt6 REQUIRED COMPONENTS Widgets)
+endif()
+
+if(NOT TARGET Qt::OpenGL)
+ find_package(Qt6 OPTIONAL_COMPONENTS OpenGL)
+endif()
-# special case:
add_library(painting_shared OBJECT)
+add_library(painting_shared::painting_shared ALIAS painting_shared)
qt6_wrap_cpp(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/
target_sources(painting_shared PRIVATE
arthurstyle.cpp arthurstyle.h
@@ -17,8 +26,9 @@ target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
if (TARGET Qt::OpenGL OR QT_FEATURE_opengles2)
target_compile_definitions(painting_shared PRIVATE QT_OPENGL_SUPPORT)
- target_link_libraries(painting_shared PRIVATE
+ target_link_libraries(painting_shared PUBLIC
Qt::OpenGL
- Qt::Widgets
)
+ qt6_wrap_cpp(moc_files_gl fbopaintdevice.h) # no automoc for OBJECT libs
+ target_sources(painting_shared PRIVATE fbopaintdevice.cpp fbopaintdevice.h ${moc_files_gl})
endif()