From d8c3375dbd0bc4327c4da3df2433f965058d1da8 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 4 Oct 2019 10:41:57 +0200 Subject: cmake: add examples/opengl Fixes: QTBUG-78164 Change-Id: Iccc8bb1354d2362c950de17a6c00e00f95272967 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- examples/CMakeLists.txt | 2 +- examples/opengl/2dpainting/CMakeLists.txt | 35 +++++++++++++ examples/opengl/CMakeLists.txt | 16 ++++++ examples/opengl/computegles31/CMakeLists.txt | 43 ++++++++++++++++ examples/opengl/contextinfo/CMakeLists.txt | 33 +++++++++++++ examples/opengl/cube/CMakeLists.txt | 57 ++++++++++++++++++++++ examples/opengl/hellogl2/CMakeLists.txt | 35 +++++++++++++ examples/opengl/hellogles3/CMakeLists.txt | 44 +++++++++++++++++ examples/opengl/hellowindow/CMakeLists.txt | 34 +++++++++++++ examples/opengl/legacy/CMakeLists.txt | 13 +++++ .../legacy/framebufferobject2/CMakeLists.txt | 47 ++++++++++++++++++ examples/opengl/legacy/grabber/CMakeLists.txt | 35 +++++++++++++ examples/opengl/legacy/hellogl/CMakeLists.txt | 39 +++++++++++++++ examples/opengl/legacy/overpainting/CMakeLists.txt | 39 +++++++++++++++ examples/opengl/legacy/pbuffers/CMakeLists.txt | 48 ++++++++++++++++++ examples/opengl/legacy/pbuffers2/CMakeLists.txt | 50 +++++++++++++++++++ .../opengl/legacy/samplebuffers/CMakeLists.txt | 34 +++++++++++++ examples/opengl/paintedwindow/CMakeLists.txt | 30 ++++++++++++ examples/opengl/qopenglwidget/CMakeLists.txt | 47 ++++++++++++++++++ examples/opengl/qopenglwindow/CMakeLists.txt | 46 +++++++++++++++++ examples/opengl/textures/CMakeLists.txt | 51 +++++++++++++++++++ .../opengl/threadedqopenglwidget/CMakeLists.txt | 33 +++++++++++++ 22 files changed, 810 insertions(+), 1 deletion(-) create mode 100644 examples/opengl/2dpainting/CMakeLists.txt create mode 100644 examples/opengl/CMakeLists.txt create mode 100644 examples/opengl/computegles31/CMakeLists.txt create mode 100644 examples/opengl/contextinfo/CMakeLists.txt create mode 100644 examples/opengl/cube/CMakeLists.txt create mode 100644 examples/opengl/hellogl2/CMakeLists.txt create mode 100644 examples/opengl/hellogles3/CMakeLists.txt create mode 100644 examples/opengl/hellowindow/CMakeLists.txt create mode 100644 examples/opengl/legacy/CMakeLists.txt create mode 100644 examples/opengl/legacy/framebufferobject2/CMakeLists.txt create mode 100644 examples/opengl/legacy/grabber/CMakeLists.txt create mode 100644 examples/opengl/legacy/hellogl/CMakeLists.txt create mode 100644 examples/opengl/legacy/overpainting/CMakeLists.txt create mode 100644 examples/opengl/legacy/pbuffers/CMakeLists.txt create mode 100644 examples/opengl/legacy/pbuffers2/CMakeLists.txt create mode 100644 examples/opengl/legacy/samplebuffers/CMakeLists.txt create mode 100644 examples/opengl/paintedwindow/CMakeLists.txt create mode 100644 examples/opengl/qopenglwidget/CMakeLists.txt create mode 100644 examples/opengl/qopenglwindow/CMakeLists.txt create mode 100644 examples/opengl/textures/CMakeLists.txt create mode 100644 examples/opengl/threadedqopenglwidget/CMakeLists.txt (limited to 'examples') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2c5c7bd88c..b473828415 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -41,7 +41,7 @@ if(TARGET Qt::Gui) add_subdirectory(gui) if(QT_FEATURE_opengl) -# add_subdirectory(opengl) # special case: removed + add_subdirectory(opengl) endif() if(QT_FEATURE_vulkan) diff --git a/examples/opengl/2dpainting/CMakeLists.txt b/examples/opengl/2dpainting/CMakeLists.txt new file mode 100644 index 0000000000..ccc26d5cff --- /dev/null +++ b/examples/opengl/2dpainting/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from 2dpainting.pro. + +cmake_minimum_required(VERSION 3.14) +project(2dpainting LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(2dpainting + glwidget.cpp glwidget.h + helper.cpp helper.h + main.cpp + widget.cpp widget.h + window.cpp window.h +) +target_link_libraries(2dpainting PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +install(TARGETS 2dpainting + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/CMakeLists.txt b/examples/opengl/CMakeLists.txt new file mode 100644 index 0000000000..53f6329463 --- /dev/null +++ b/examples/opengl/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from opengl.pro. + +add_subdirectory(hellowindow) +add_subdirectory(paintedwindow) +add_subdirectory(qopenglwindow) +if(TARGET Qt::Widgets) + add_subdirectory(contextinfo) + add_subdirectory(threadedqopenglwidget) + add_subdirectory(2dpainting) + add_subdirectory(hellogl2) + add_subdirectory(qopenglwidget) + add_subdirectory(cube) + add_subdirectory(textures) + add_subdirectory(hellogles3) + add_subdirectory(computegles31) +endif() diff --git a/examples/opengl/computegles31/CMakeLists.txt b/examples/opengl/computegles31/CMakeLists.txt new file mode 100644 index 0000000000..306fe8638e --- /dev/null +++ b/examples/opengl/computegles31/CMakeLists.txt @@ -0,0 +1,43 @@ +# Generated from computegles31.pro. + +cmake_minimum_required(VERSION 3.14) +project(computegles31 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) + +add_qt_gui_executable(computegles31 + glwindow.cpp glwindow.h + main.cpp +) +target_link_libraries(computegles31 PUBLIC + Qt::Core + Qt::Gui +) + +# Resources: +set(computegles31_resource_files + "Qt-logo-medium.png" +) + +qt6_add_resources(computegles31 "computegles31" + PREFIX + "/" + FILES + ${computegles31_resource_files} +) + + +install(TARGETS computegles31 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/contextinfo/CMakeLists.txt b/examples/opengl/contextinfo/CMakeLists.txt new file mode 100644 index 0000000000..dca5b9bab4 --- /dev/null +++ b/examples/opengl/contextinfo/CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from contextinfo.pro. + +cmake_minimum_required(VERSION 3.14) +project(contextinfo LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(contextinfo + main.cpp + renderwindow.cpp renderwindow.h + widget.cpp widget.h +) +target_link_libraries(contextinfo PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +install(TARGETS contextinfo + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/cube/CMakeLists.txt b/examples/opengl/cube/CMakeLists.txt new file mode 100644 index 0000000000..8527a966ae --- /dev/null +++ b/examples/opengl/cube/CMakeLists.txt @@ -0,0 +1,57 @@ +# Generated from cube.pro. + +cmake_minimum_required(VERSION 3.14) +project(cube LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(cube + geometryengine.cpp geometryengine.h + main.cpp + mainwidget.cpp mainwidget.h +) +target_link_libraries(cube PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +# Resources: +set(shaders_resource_files + "fshader.glsl" + "vshader.glsl" +) + +qt6_add_resources(cube "shaders" + PREFIX + "/" + FILES + ${shaders_resource_files} +) +set(textures_resource_files + "cube.png" +) + +qt6_add_resources(cube "textures" + PREFIX + "/" + FILES + ${textures_resource_files} +) + + +install(TARGETS cube + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/hellogl2/CMakeLists.txt b/examples/opengl/hellogl2/CMakeLists.txt new file mode 100644 index 0000000000..06ea78d959 --- /dev/null +++ b/examples/opengl/hellogl2/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from hellogl2.pro. + +cmake_minimum_required(VERSION 3.14) +project(hellogl2 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(hellogl2 + glwidget.cpp glwidget.h + logo.cpp logo.h + main.cpp + mainwindow.cpp mainwindow.h + window.cpp window.h +) +target_link_libraries(hellogl2 PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +install(TARGETS hellogl2 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/hellogles3/CMakeLists.txt b/examples/opengl/hellogles3/CMakeLists.txt new file mode 100644 index 0000000000..d642b214c8 --- /dev/null +++ b/examples/opengl/hellogles3/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from hellogles3.pro. + +cmake_minimum_required(VERSION 3.14) +project(hellogles3 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) + +add_qt_gui_executable(hellogles3 + ../hellogl2/logo.cpp ../hellogl2/logo.h + glwindow.cpp glwindow.h + main.cpp +) +target_link_libraries(hellogles3 PUBLIC + Qt::Core + Qt::Gui +) + +# Resources: +set(hellogles3_resource_files + "qtlogo.png" +) + +qt6_add_resources(hellogles3 "hellogles3" + PREFIX + "/" + FILES + ${hellogles3_resource_files} +) + + +install(TARGETS hellogles3 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/hellowindow/CMakeLists.txt b/examples/opengl/hellowindow/CMakeLists.txt new file mode 100644 index 0000000000..341b52b2cb --- /dev/null +++ b/examples/opengl/hellowindow/CMakeLists.txt @@ -0,0 +1,34 @@ +# Generated from hellowindow.pro. + +cmake_minimum_required(VERSION 3.14) +project(hellowindow LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) + +add_qt_gui_executable(hellowindow + hellowindow.cpp hellowindow.h + main.cpp +) +target_link_libraries(hellowindow PRIVATE + Qt::CorePrivate + Qt::GuiPrivate +) +target_link_libraries(hellowindow PUBLIC + Qt::Core + Qt::Gui +) + +install(TARGETS hellowindow + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/legacy/CMakeLists.txt b/examples/opengl/legacy/CMakeLists.txt new file mode 100644 index 0000000000..5f98186a0e --- /dev/null +++ b/examples/opengl/legacy/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from legacy.pro. + +if(NOT TARGET Qt::OpenGL) + return() +endif() +if(NOT QT_FEATURE_dynamicgl AND NOT QT_FEATURE_opengles2) + add_subdirectory(grabber) + add_subdirectory(hellogl) + add_subdirectory(overpainting) + add_subdirectory(pbuffers) + add_subdirectory(framebufferobject2) + add_subdirectory(samplebuffers) +endif() diff --git a/examples/opengl/legacy/framebufferobject2/CMakeLists.txt b/examples/opengl/legacy/framebufferobject2/CMakeLists.txt new file mode 100644 index 0000000000..74b00e8359 --- /dev/null +++ b/examples/opengl/legacy/framebufferobject2/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from framebufferobject2.pro. + +cmake_minimum_required(VERSION 3.14) +project(framebufferobject2 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(framebufferobject2 + glwidget.cpp glwidget.h + main.cpp +) +target_link_libraries(framebufferobject2 PUBLIC + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Widgets +) + +# Resources: +set(framebufferobject2_resource_files + "cubelogo.png" +) + +qt6_add_resources(framebufferobject2 "framebufferobject2" + PREFIX + "/res" + FILES + ${framebufferobject2_resource_files} +) + + +install(TARGETS framebufferobject2 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/legacy/grabber/CMakeLists.txt b/examples/opengl/legacy/grabber/CMakeLists.txt new file mode 100644 index 0000000000..13ffd6fc31 --- /dev/null +++ b/examples/opengl/legacy/grabber/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from grabber.pro. + +cmake_minimum_required(VERSION 3.14) +project(grabber LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(grabber + glwidget.cpp glwidget.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(grabber PUBLIC + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Widgets +) + +install(TARGETS grabber + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/legacy/hellogl/CMakeLists.txt b/examples/opengl/legacy/hellogl/CMakeLists.txt new file mode 100644 index 0000000000..5e61d52964 --- /dev/null +++ b/examples/opengl/legacy/hellogl/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from hellogl.pro. + +cmake_minimum_required(VERSION 3.14) +project(hellogl LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(hellogl + ../shared/qtlogo.cpp ../shared/qtlogo.h + glwidget.cpp glwidget.h + main.cpp + window.cpp window.h +) +target_include_directories(hellogl PUBLIC + ../shared +) +target_link_libraries(hellogl PUBLIC + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Widgets +) + +install(TARGETS hellogl + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/legacy/overpainting/CMakeLists.txt b/examples/opengl/legacy/overpainting/CMakeLists.txt new file mode 100644 index 0000000000..4addb8a3c6 --- /dev/null +++ b/examples/opengl/legacy/overpainting/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from overpainting.pro. + +cmake_minimum_required(VERSION 3.14) +project(overpainting LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(overpainting + ../shared/qtlogo.cpp ../shared/qtlogo.h + bubble.cpp bubble.h + glwidget.cpp glwidget.h + main.cpp +) +target_include_directories(overpainting PUBLIC + ../shared +) +target_link_libraries(overpainting PUBLIC + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Widgets +) + +install(TARGETS overpainting + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/legacy/pbuffers/CMakeLists.txt b/examples/opengl/legacy/pbuffers/CMakeLists.txt new file mode 100644 index 0000000000..eb3de5535a --- /dev/null +++ b/examples/opengl/legacy/pbuffers/CMakeLists.txt @@ -0,0 +1,48 @@ +# Generated from pbuffers.pro. + +cmake_minimum_required(VERSION 3.14) +project(pbuffers LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(pbuffers + cube.cpp cube.h + glwidget.cpp glwidget.h + main.cpp +) +target_link_libraries(pbuffers PUBLIC + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Widgets +) + +# Resources: +set(pbuffers_resource_files + "cubelogo.png" +) + +qt6_add_resources(pbuffers "pbuffers" + PREFIX + "/res" + FILES + ${pbuffers_resource_files} +) + + +install(TARGETS pbuffers + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/legacy/pbuffers2/CMakeLists.txt b/examples/opengl/legacy/pbuffers2/CMakeLists.txt new file mode 100644 index 0000000000..b82e2f35c6 --- /dev/null +++ b/examples/opengl/legacy/pbuffers2/CMakeLists.txt @@ -0,0 +1,50 @@ +# Generated from pbuffers2.pro. + +cmake_minimum_required(VERSION 3.14) +project(pbuffers2 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 COMPONENTS Svg) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(pbuffers2 + glwidget.cpp glwidget.h + main.cpp +) +target_link_libraries(pbuffers2 PUBLIC + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Svg + Qt::Widgets +) + +# Resources: +set(pbuffers2_resource_files + "bubbles.svg" + "designer.png" +) + +qt6_add_resources(pbuffers2 "pbuffers2" + PREFIX + "/res" + FILES + ${pbuffers2_resource_files} +) + + +install(TARGETS pbuffers2 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/legacy/samplebuffers/CMakeLists.txt b/examples/opengl/legacy/samplebuffers/CMakeLists.txt new file mode 100644 index 0000000000..3d500fa55e --- /dev/null +++ b/examples/opengl/legacy/samplebuffers/CMakeLists.txt @@ -0,0 +1,34 @@ +# Generated from samplebuffers.pro. + +cmake_minimum_required(VERSION 3.14) +project(samplebuffers LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(samplebuffers + glwidget.cpp glwidget.h + main.cpp +) +target_link_libraries(samplebuffers PUBLIC + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Widgets +) + +install(TARGETS samplebuffers + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/paintedwindow/CMakeLists.txt b/examples/opengl/paintedwindow/CMakeLists.txt new file mode 100644 index 0000000000..7333b0697c --- /dev/null +++ b/examples/opengl/paintedwindow/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from paintedwindow.pro. + +cmake_minimum_required(VERSION 3.14) +project(paintedwindow LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) + +add_qt_gui_executable(paintedwindow + main.cpp + paintedwindow.cpp paintedwindow.h +) +target_link_libraries(paintedwindow PUBLIC + Qt::Core + Qt::Gui +) + +install(TARGETS paintedwindow + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/qopenglwidget/CMakeLists.txt b/examples/opengl/qopenglwidget/CMakeLists.txt new file mode 100644 index 0000000000..1531343a28 --- /dev/null +++ b/examples/opengl/qopenglwidget/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from qopenglwidget.pro. + +cmake_minimum_required(VERSION 3.14) +project(qopenglwidget LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(qopenglwidget + bubble.cpp bubble.h + glwidget.cpp glwidget.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(qopenglwidget PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +# Resources: +set(texture_resource_files + "qt.png" +) + +qt6_add_resources(qopenglwidget "texture" + PREFIX + "/" + FILES + ${texture_resource_files} +) + + +install(TARGETS qopenglwidget + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/qopenglwindow/CMakeLists.txt b/examples/opengl/qopenglwindow/CMakeLists.txt new file mode 100644 index 0000000000..182262791e --- /dev/null +++ b/examples/opengl/qopenglwindow/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from qopenglwindow.pro. + +cmake_minimum_required(VERSION 3.14) +project(qopenglwindow LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) + +add_qt_gui_executable(qopenglwindow + background_renderer.cpp background_renderer.h + main.cpp +) +target_include_directories(qopenglwindow PUBLIC + . +) +target_link_libraries(qopenglwindow PUBLIC + Qt::Core + Qt::Gui +) + +# Resources: +set(shaders_resource_files + "background.frag" +) + +qt6_add_resources(qopenglwindow "shaders" + PREFIX + "/" + FILES + ${shaders_resource_files} +) + + +install(TARGETS qopenglwindow + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/textures/CMakeLists.txt b/examples/opengl/textures/CMakeLists.txt new file mode 100644 index 0000000000..69ae694f74 --- /dev/null +++ b/examples/opengl/textures/CMakeLists.txt @@ -0,0 +1,51 @@ +# Generated from textures.pro. + +cmake_minimum_required(VERSION 3.14) +project(textures LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(textures + glwidget.cpp glwidget.h + main.cpp + window.cpp window.h +) +target_link_libraries(textures PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +# Resources: +set(textures_resource_files + "images/side1.png" + "images/side2.png" + "images/side3.png" + "images/side4.png" + "images/side5.png" + "images/side6.png" +) + +qt6_add_resources(textures "textures" + PREFIX + "/" + FILES + ${textures_resource_files} +) + + +install(TARGETS textures + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/opengl/threadedqopenglwidget/CMakeLists.txt b/examples/opengl/threadedqopenglwidget/CMakeLists.txt new file mode 100644 index 0000000000..20bee78283 --- /dev/null +++ b/examples/opengl/threadedqopenglwidget/CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from threadedqopenglwidget.pro. + +cmake_minimum_required(VERSION 3.14) +project(threadedqopenglwidget LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(threadedqopenglwidget + glwidget.cpp glwidget.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(threadedqopenglwidget PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets +) + +install(TARGETS threadedqopenglwidget + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) -- cgit v1.2.3