summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-27 13:25:34 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-01-30 20:45:08 +0000
commit43d2b60a29df5397be4b4bead90f40346bf85dce (patch)
tree7ac735998206e9ed76eca98d335490ad5d98bd1f /examples
parenta1dbdcbd6e818118f5fc28cdd39e47a02380adbd (diff)
Post-merge fixes
Change-Id: I6acd29103f6cc550544e7422328d97ea0e2dcafb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/gui/CMakeLists.txt7
-rw-r--r--examples/opengl/CMakeLists.txt1
-rw-r--r--examples/opengl/openglwindow/.prev_CMakeLists.txt36
-rw-r--r--examples/opengl/openglwindow/CMakeLists.txt (renamed from examples/gui/openglwindow/CMakeLists.txt)14
-rw-r--r--examples/opengl/paintedwindow/CMakeLists.txt2
-rw-r--r--examples/widgets/windowcontainer/CMakeLists.txt13
6 files changed, 61 insertions, 12 deletions
diff --git a/examples/gui/CMakeLists.txt b/examples/gui/CMakeLists.txt
index 7ae4c6bc6a..7631777ef4 100644
--- a/examples/gui/CMakeLists.txt
+++ b/examples/gui/CMakeLists.txt
@@ -1,8 +1,7 @@
# Generated from gui.pro.
+if(NOT TARGET Qt::Gui)
+ return()
+endif()
add_subdirectory(analogclock)
add_subdirectory(rasterwindow)
-
-if(TARGET Qt::Gui AND QT_FEATURE_opengl)
- add_subdirectory(openglwindow)
-endif()
diff --git a/examples/opengl/CMakeLists.txt b/examples/opengl/CMakeLists.txt
index 53f6329463..3d5b055b1a 100644
--- a/examples/opengl/CMakeLists.txt
+++ b/examples/opengl/CMakeLists.txt
@@ -2,6 +2,7 @@
add_subdirectory(hellowindow)
add_subdirectory(paintedwindow)
+add_subdirectory(openglwindow)
add_subdirectory(qopenglwindow)
if(TARGET Qt::Widgets)
add_subdirectory(contextinfo)
diff --git a/examples/opengl/openglwindow/.prev_CMakeLists.txt b/examples/opengl/openglwindow/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..9780e18c7f
--- /dev/null
+++ b/examples/opengl/openglwindow/.prev_CMakeLists.txt
@@ -0,0 +1,36 @@
+# Generated from openglwindow.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(openglwindow LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/opengl/openglwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
+
+add_qt_gui_executable(openglwindow
+ main.cpp
+ openglwindow.cpp openglwindow.h
+)
+target_include_directories(openglwindow PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+target_link_libraries(openglwindow PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
+)
+
+install(TARGETS openglwindow
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/gui/openglwindow/CMakeLists.txt b/examples/opengl/openglwindow/CMakeLists.txt
index 98fc40fd9a..9780e18c7f 100644
--- a/examples/gui/openglwindow/CMakeLists.txt
+++ b/examples/opengl/openglwindow/CMakeLists.txt
@@ -3,15 +3,17 @@
cmake_minimum_required(VERSION 3.14)
project(openglwindow LANGUAGES CXX)
-find_package(Qt6 COMPONENTS Widgets) # special case: add
-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/opengl/openglwindow")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
add_qt_gui_executable(openglwindow
main.cpp
@@ -20,11 +22,13 @@ add_qt_gui_executable(openglwindow
target_include_directories(openglwindow PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
-# special case begin
+
target_link_libraries(openglwindow PUBLIC
+ Qt::Core
Qt::Gui
+ Qt::OpenGL
)
-# special case end
+
install(TARGETS openglwindow
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/opengl/paintedwindow/CMakeLists.txt b/examples/opengl/paintedwindow/CMakeLists.txt
index 6d36a0e001..2711bdc45b 100644
--- a/examples/opengl/paintedwindow/CMakeLists.txt
+++ b/examples/opengl/paintedwindow/CMakeLists.txt
@@ -13,6 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples/opengl/paintedwindow")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS OpenGL)
add_qt_gui_executable(paintedwindow
main.cpp
@@ -21,6 +22,7 @@ add_qt_gui_executable(paintedwindow
target_link_libraries(paintedwindow PUBLIC
Qt::Core
Qt::Gui
+ Qt::OpenGL
)
install(TARGETS paintedwindow
diff --git a/examples/widgets/windowcontainer/CMakeLists.txt b/examples/widgets/windowcontainer/CMakeLists.txt
index 463fe8f8a6..399cade1c5 100644
--- a/examples/widgets/windowcontainer/CMakeLists.txt
+++ b/examples/widgets/windowcontainer/CMakeLists.txt
@@ -9,18 +9,25 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/widgets/windowcontainer")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS OpenGL)
add_qt_gui_executable(windowcontainer
- ../../gui/openglwindow/openglwindow.cpp ../../gui/openglwindow/openglwindow.h
+ ../../opengl/openglwindow/openglwindow.cpp ../../opengl/openglwindow/openglwindow.h
windowcontainer.cpp
)
target_include_directories(windowcontainer PUBLIC
- ../../gui/openglwindow
+ ../../opengl/openglwindow
)
+
target_link_libraries(windowcontainer PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGL
Qt::Widgets
)