From 43d2b60a29df5397be4b4bead90f40346bf85dce Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 27 Jan 2020 13:25:34 +0100 Subject: Post-merge fixes Change-Id: I6acd29103f6cc550544e7422328d97ea0e2dcafb Reviewed-by: Simon Hausmann --- examples/gui/CMakeLists.txt | 7 ++--- examples/gui/openglwindow/CMakeLists.txt | 32 -------------------- examples/opengl/CMakeLists.txt | 1 + examples/opengl/openglwindow/.prev_CMakeLists.txt | 36 +++++++++++++++++++++++ examples/opengl/openglwindow/CMakeLists.txt | 36 +++++++++++++++++++++++ examples/opengl/paintedwindow/CMakeLists.txt | 2 ++ examples/widgets/windowcontainer/CMakeLists.txt | 13 ++++++-- 7 files changed, 88 insertions(+), 39 deletions(-) delete mode 100644 examples/gui/openglwindow/CMakeLists.txt create mode 100644 examples/opengl/openglwindow/.prev_CMakeLists.txt create mode 100644 examples/opengl/openglwindow/CMakeLists.txt (limited to 'examples') 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/gui/openglwindow/CMakeLists.txt b/examples/gui/openglwindow/CMakeLists.txt deleted file mode 100644 index 98fc40fd9a..0000000000 --- a/examples/gui/openglwindow/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Generated from openglwindow.pro. - -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") - -add_qt_gui_executable(openglwindow - main.cpp - openglwindow.cpp openglwindow.h -) -target_include_directories(openglwindow PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) -# special case begin -target_link_libraries(openglwindow PUBLIC - Qt::Gui -) -# special case end -install(TARGETS openglwindow - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) 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/opengl/openglwindow/CMakeLists.txt b/examples/opengl/openglwindow/CMakeLists.txt new file mode 100644 index 0000000000..9780e18c7f --- /dev/null +++ b/examples/opengl/openglwindow/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/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 ) -- cgit v1.2.3