From 36b4ac5206dde6859a02df0db406ebca0eda5111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Mon, 14 Feb 2022 19:42:01 +0100 Subject: Improve examples CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove "# generated from xyz.pro" comment from pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: I3ce281ae1fb44c8d54ee09860ddadd3dbbdf7271 Reviewed-by: Qt CI Bot Reviewed-by: Jörg Bornemann --- examples/CMakeLists.txt | 2 -- examples/wayland/CMakeLists.txt | 6 ++---- examples/wayland/custom-extension/CMakeLists.txt | 2 -- .../custom-extension/compositor/CMakeLists.txt | 18 +++++------------- .../custom-extension/cpp-client/CMakeLists.txt | 16 +++++----------- .../custom-extension/qml-client/CMakeLists.txt | 19 +++++-------------- .../wayland/custom-shell/client-plugin/CMakeLists.txt | 10 ++-------- .../wayland/custom-shell/compositor/CMakeLists.txt | 18 +++++------------- examples/wayland/hwlayer-compositor/CMakeLists.txt | 15 ++++----------- examples/wayland/ivi-compositor/CMakeLists.txt | 15 ++++----------- examples/wayland/minimal-cpp/CMakeLists.txt | 16 +++++----------- examples/wayland/minimal-qml/CMakeLists.txt | 15 ++++----------- examples/wayland/multi-output/CMakeLists.txt | 15 ++++----------- examples/wayland/multi-screen/CMakeLists.txt | 15 ++++----------- examples/wayland/overview-compositor/CMakeLists.txt | 15 ++++----------- examples/wayland/pure-qml/CMakeLists.txt | 15 ++++----------- examples/wayland/qtshell/CMakeLists.txt | 11 +++-------- examples/wayland/server-buffer/CMakeLists.txt | 2 -- .../wayland/server-buffer/compositor/CMakeLists.txt | 18 +++++------------- .../wayland/server-buffer/cpp-client/CMakeLists.txt | 17 +++++------------ .../wayland/server-side-decoration/CMakeLists.txt | 15 ++++----------- examples/wayland/spanning-screens/CMakeLists.txt | 15 ++++----------- 22 files changed, 78 insertions(+), 212 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bcfd44643..5f219b0cd 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from examples.pro. - qt_examples_build_begin(EXTERNAL_BUILD) add_subdirectory(wayland) diff --git a/examples/wayland/CMakeLists.txt b/examples/wayland/CMakeLists.txt index c4553bdb7..20ee212cb 100644 --- a/examples/wayland/CMakeLists.txt +++ b/examples/wayland/CMakeLists.txt @@ -1,6 +1,4 @@ -# Generated from wayland.pro. - -if(QT_FEATURE_wayland_server) # special case +if(QT_FEATURE_wayland_server) if(QT_FEATURE_opengl) qt_internal_add_example(minimal-cpp) endif() @@ -23,4 +21,4 @@ endif() if(QT_FEATURE_opengl AND TARGET Qt::Quick AND TARGET Qt::WaylandClient) add_subdirectory(server-buffer) endif() -endif() # special case +endif() diff --git a/examples/wayland/custom-extension/CMakeLists.txt b/examples/wayland/custom-extension/CMakeLists.txt index bdf9e1245..99f12303f 100644 --- a/examples/wayland/custom-extension/CMakeLists.txt +++ b/examples/wayland/custom-extension/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from custom-extension.pro. - qt_internal_add_example(qml-client) qt_internal_add_example(compositor) qt_internal_add_example(cpp-client) diff --git a/examples/wayland/custom-extension/compositor/CMakeLists.txt b/examples/wayland/custom-extension/compositor/CMakeLists.txt index 1826c745f..8692dd6c9 100644 --- a/examples/wayland/custom-extension/compositor/CMakeLists.txt +++ b/examples/wayland/custom-extension/compositor/CMakeLists.txt @@ -1,24 +1,15 @@ -# Generated from compositor.pro. - cmake_minimum_required(VERSION 3.16) -project(custom-extension-compositor) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(custom-extension-compositor) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/custom-extension/compositor") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS WaylandCompositor) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml WaylandCompositor) qt_add_executable(custom-extension-compositor customextension.cpp customextension.h @@ -29,10 +20,12 @@ qt6_generate_wayland_protocol_server_sources(custom-extension-compositor FILES ${CMAKE_CURRENT_SOURCE_DIR}/../protocol/custom.xml ) + set_target_properties(custom-extension-compositor PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(custom-extension-compositor PUBLIC Qt::Core Qt::Gui @@ -40,7 +33,6 @@ target_link_libraries(custom-extension-compositor PUBLIC Qt::WaylandCompositor ) - # Resources: set(compositor_resource_files "images/background.png" diff --git a/examples/wayland/custom-extension/cpp-client/CMakeLists.txt b/examples/wayland/custom-extension/cpp-client/CMakeLists.txt index 30012c748..eeacfd296 100644 --- a/examples/wayland/custom-extension/cpp-client/CMakeLists.txt +++ b/examples/wayland/custom-extension/cpp-client/CMakeLists.txt @@ -1,23 +1,15 @@ -# Generated from cpp-client.pro. - cmake_minimum_required(VERSION 3.16) -project(custom-extension-cpp-client) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(custom-extension-cpp-client) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/custom-extension/cpp-client") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS WaylandClient) +find_package(Qt6 REQUIRED COMPONENTS Core Gui WaylandClient) qt_add_executable(custom-extension-cpp-client ../client-common/customextension.cpp ../client-common/customextension.h @@ -28,10 +20,12 @@ qt6_generate_wayland_protocol_client_sources(custom-extension-cpp-client FILES ${CMAKE_CURRENT_SOURCE_DIR}/../protocol/custom.xml ) + set_target_properties(custom-extension-cpp-client PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(custom-extension-cpp-client PUBLIC Qt::Core Qt::Gui diff --git a/examples/wayland/custom-extension/qml-client/CMakeLists.txt b/examples/wayland/custom-extension/qml-client/CMakeLists.txt index 6d7688e6b..256ade9b3 100644 --- a/examples/wayland/custom-extension/qml-client/CMakeLists.txt +++ b/examples/wayland/custom-extension/qml-client/CMakeLists.txt @@ -1,25 +1,15 @@ -# Generated from qml-client.pro. - cmake_minimum_required(VERSION 3.16) -project(custom-extension-qml-client) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(custom-extension-qml-client) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/custom-extension/qml-client") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS WaylandClient) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick WaylandClient) qt_add_executable(custom-extension-qml-client ../client-common/customextension.cpp ../client-common/customextension.h @@ -30,10 +20,12 @@ qt6_generate_wayland_protocol_client_sources(custom-extension-qml-client FILES ${CMAKE_CURRENT_SOURCE_DIR}/../protocol/custom.xml ) + set_target_properties(custom-extension-qml-client PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(custom-extension-qml-client PUBLIC Qt::Core Qt::Gui @@ -43,7 +35,6 @@ target_link_libraries(custom-extension-qml-client PUBLIC Qt::WaylandClient ) - # Resources: set(qml_resource_files "main.qml" diff --git a/examples/wayland/custom-shell/client-plugin/CMakeLists.txt b/examples/wayland/custom-shell/client-plugin/CMakeLists.txt index 8af9aeb30..1004a664e 100644 --- a/examples/wayland/custom-shell/client-plugin/CMakeLists.txt +++ b/examples/wayland/custom-shell/client-plugin/CMakeLists.txt @@ -1,21 +1,15 @@ cmake_minimum_required(VERSION 3.14) project(exampleshellplugin LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/custom-shell/plugins") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS WaylandClient) +find_package(Qt6 REQUIRED COMPONENTS Core Gui WaylandClient) qt_add_plugin(exampleshellplugin) target_sources(exampleshellplugin PRIVATE diff --git a/examples/wayland/custom-shell/compositor/CMakeLists.txt b/examples/wayland/custom-shell/compositor/CMakeLists.txt index aab5a5585..a6a7ced9c 100644 --- a/examples/wayland/custom-shell/compositor/CMakeLists.txt +++ b/examples/wayland/custom-shell/compositor/CMakeLists.txt @@ -1,24 +1,15 @@ -# Generated from compositor.pro. - cmake_minimum_required(VERSION 3.14) -project(custom-shell-compositor) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(custom-shell-compositor) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/custom-shell/compositor") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS WaylandCompositor) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml WaylandCompositor) qt_add_executable(custom-shell-compositor exampleshell.cpp exampleshell.h @@ -30,10 +21,12 @@ qt6_generate_wayland_protocol_server_sources(custom-shell-compositor FILES ${CMAKE_CURRENT_SOURCE_DIR}/../protocol/example-shell.xml ) + set_target_properties(custom-shell-compositor PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(custom-shell-compositor PUBLIC Qt::Core Qt::Gui @@ -41,7 +34,6 @@ target_link_libraries(custom-shell-compositor PUBLIC Qt::WaylandCompositor ) - # Resources: set(compositor_resource_files "images/background.png" diff --git a/examples/wayland/hwlayer-compositor/CMakeLists.txt b/examples/wayland/hwlayer-compositor/CMakeLists.txt index 2fa09e7ee..049d4ad2f 100644 --- a/examples/wayland/hwlayer-compositor/CMakeLists.txt +++ b/examples/wayland/hwlayer-compositor/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from hwlayer-compositor.pro. - cmake_minimum_required(VERSION 3.16) project(hwlayer-compositor LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/hwlayer-compositor") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(hwlayer-compositor main.cpp ) + set_target_properties(hwlayer-compositor PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(hwlayer-compositor PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(hwlayer-compositor_resource_files "main.qml" diff --git a/examples/wayland/ivi-compositor/CMakeLists.txt b/examples/wayland/ivi-compositor/CMakeLists.txt index d198c8059..b78728eea 100644 --- a/examples/wayland/ivi-compositor/CMakeLists.txt +++ b/examples/wayland/ivi-compositor/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from ivi-compositor.pro. - cmake_minimum_required(VERSION 3.16) project(ivi-compositor LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/ivi-compositor") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(ivi-compositor main.cpp ) + set_target_properties(ivi-compositor PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(ivi-compositor PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(ivi-compositor_resource_files "main.qml" diff --git a/examples/wayland/minimal-cpp/CMakeLists.txt b/examples/wayland/minimal-cpp/CMakeLists.txt index abc99d6b9..e8d4efdd6 100644 --- a/examples/wayland/minimal-cpp/CMakeLists.txt +++ b/examples/wayland/minimal-cpp/CMakeLists.txt @@ -1,40 +1,34 @@ -# Generated from minimal-cpp.pro. - cmake_minimum_required(VERSION 3.16) project(minimal-cpp LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/minimal-cpp") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS WaylandCompositor) +find_package(Qt6 REQUIRED COMPONENTS Core Gui WaylandCompositor) qt_add_executable(minimal-cpp compositor.cpp compositor.h main.cpp window.cpp window.h ) + set_target_properties(minimal-cpp PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_include_directories(minimal-cpp PUBLIC ../../include ) target_link_libraries(minimal-cpp PUBLIC # Remove: L - #../../lib # special case + #../../lib Qt::Core Qt::Gui Qt::WaylandCompositor diff --git a/examples/wayland/minimal-qml/CMakeLists.txt b/examples/wayland/minimal-qml/CMakeLists.txt index 6f9b0ac2c..c960e9665 100644 --- a/examples/wayland/minimal-qml/CMakeLists.txt +++ b/examples/wayland/minimal-qml/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from minimal-qml.pro. - cmake_minimum_required(VERSION 3.16) project(minimal-qml LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/minimal-qml") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(minimal-qml main.cpp ) + set_target_properties(minimal-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(minimal-qml PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(minimal-qml_resource_files "main.qml" diff --git a/examples/wayland/multi-output/CMakeLists.txt b/examples/wayland/multi-output/CMakeLists.txt index 0a4ee50d0..c24b9e5d7 100644 --- a/examples/wayland/multi-output/CMakeLists.txt +++ b/examples/wayland/multi-output/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from multi-output.pro. - cmake_minimum_required(VERSION 3.16) project(multi-output LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/multi-output") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(multi-output main.cpp ) + set_target_properties(multi-output PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(multi-output PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(multi-output_resource_files "images/background.jpg" diff --git a/examples/wayland/multi-screen/CMakeLists.txt b/examples/wayland/multi-screen/CMakeLists.txt index df6357cc4..f23f890bd 100644 --- a/examples/wayland/multi-screen/CMakeLists.txt +++ b/examples/wayland/multi-screen/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from multi-screen.pro. - cmake_minimum_required(VERSION 3.16) project(multi-screen LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/multi-screen") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(multi-screen main.cpp ) + set_target_properties(multi-screen PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(multi-screen PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(multi-screen_resource_files "qml/Chrome.qml" diff --git a/examples/wayland/overview-compositor/CMakeLists.txt b/examples/wayland/overview-compositor/CMakeLists.txt index 97fd15e32..712d2feb6 100644 --- a/examples/wayland/overview-compositor/CMakeLists.txt +++ b/examples/wayland/overview-compositor/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from overview-compositor.pro. - cmake_minimum_required(VERSION 3.16) project(overview-compositor LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/overview-compositor") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(overview-compositor main.cpp ) + set_target_properties(overview-compositor PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(overview-compositor PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(overview-compositor_resource_files "main.qml" diff --git a/examples/wayland/pure-qml/CMakeLists.txt b/examples/wayland/pure-qml/CMakeLists.txt index 3be6e2239..f008086de 100644 --- a/examples/wayland/pure-qml/CMakeLists.txt +++ b/examples/wayland/pure-qml/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from pure-qml.pro. - cmake_minimum_required(VERSION 3.16) project(pure-qml LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/pure-qml") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(pure-qml main.cpp ) + set_target_properties(pure-qml PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(pure-qml PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(pure-qml_resource_files "images/background.jpg" diff --git a/examples/wayland/qtshell/CMakeLists.txt b/examples/wayland/qtshell/CMakeLists.txt index c6d3b3793..763dc2dc0 100644 --- a/examples/wayland/qtshell/CMakeLists.txt +++ b/examples/wayland/qtshell/CMakeLists.txt @@ -1,30 +1,25 @@ cmake_minimum_required(VERSION 3.14) project(qtshell LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(qtshell main.cpp ) + set_target_properties(qtshell PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qtshell PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(qtshell_resource_files "images/background.jpg" diff --git a/examples/wayland/server-buffer/CMakeLists.txt b/examples/wayland/server-buffer/CMakeLists.txt index 751ebc0f1..48a68e96b 100644 --- a/examples/wayland/server-buffer/CMakeLists.txt +++ b/examples/wayland/server-buffer/CMakeLists.txt @@ -1,4 +1,2 @@ -# Generated from server-buffer.pro. - qt_internal_add_example(cpp-client) qt_internal_add_example(compositor) diff --git a/examples/wayland/server-buffer/compositor/CMakeLists.txt b/examples/wayland/server-buffer/compositor/CMakeLists.txt index 1d181a8e3..d270106dc 100644 --- a/examples/wayland/server-buffer/compositor/CMakeLists.txt +++ b/examples/wayland/server-buffer/compositor/CMakeLists.txt @@ -1,24 +1,15 @@ -# Generated from compositor.pro. - cmake_minimum_required(VERSION 3.16) -project(compositor) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(compositor) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/server-buffer/compositor") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS WaylandCompositor) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml WaylandCompositor) qt_add_executable(compositor main.cpp @@ -29,10 +20,12 @@ qt6_generate_wayland_protocol_server_sources(compositor FILES ${CMAKE_CURRENT_SOURCE_DIR}/../share-buffer.xml ) + set_target_properties(compositor PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(compositor PUBLIC Qt::Core Qt::Gui @@ -40,7 +33,6 @@ target_link_libraries(compositor PUBLIC Qt::WaylandCompositorPrivate ) - # Resources: set(compositor_resource_files "images/Siberischer_tiger_de_edit02.jpg" diff --git a/examples/wayland/server-buffer/cpp-client/CMakeLists.txt b/examples/wayland/server-buffer/cpp-client/CMakeLists.txt index 6787e3f7c..5ecec45ed 100644 --- a/examples/wayland/server-buffer/cpp-client/CMakeLists.txt +++ b/examples/wayland/server-buffer/cpp-client/CMakeLists.txt @@ -1,24 +1,15 @@ -# Generated from cpp-client.pro. - cmake_minimum_required(VERSION 3.16) -project(server-buffer-cpp-client) # special case - -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(server-buffer-cpp-client) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/server-buffer/cpp-client") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS WaylandClient) -find_package(Qt6 COMPONENTS OpenGL) +find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL WaylandClient) qt_add_executable(server-buffer-cpp-client main.cpp @@ -29,10 +20,12 @@ qt6_generate_wayland_protocol_client_sources(server-buffer-cpp-client FILES ${CMAKE_CURRENT_SOURCE_DIR}/../share-buffer.xml ) + set_target_properties(server-buffer-cpp-client PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(server-buffer-cpp-client PUBLIC Qt::Core Qt::Gui diff --git a/examples/wayland/server-side-decoration/CMakeLists.txt b/examples/wayland/server-side-decoration/CMakeLists.txt index 01895f425..391fd5f9c 100644 --- a/examples/wayland/server-side-decoration/CMakeLists.txt +++ b/examples/wayland/server-side-decoration/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from server-side-decoration.pro. - cmake_minimum_required(VERSION 3.16) project(server-side-decoration LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/server-side-decoration") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(server-side-decoration main.cpp ) + set_target_properties(server-side-decoration PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(server-side-decoration PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(server-side-decoration_resource_files "main.qml" diff --git a/examples/wayland/spanning-screens/CMakeLists.txt b/examples/wayland/spanning-screens/CMakeLists.txt index 58d38f2f8..2f2761855 100644 --- a/examples/wayland/spanning-screens/CMakeLists.txt +++ b/examples/wayland/spanning-screens/CMakeLists.txt @@ -1,38 +1,31 @@ -# Generated from spanning-screens.pro. - cmake_minimum_required(VERSION 3.16) project(spanning-screens LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/wayland/spanning-screens") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(spanning-screens main.cpp ) + set_target_properties(spanning-screens PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(spanning-screens PUBLIC Qt::Core Qt::Gui Qt::Qml ) - # Resources: set(spanning-screens_resource_files "main.qml" -- cgit v1.2.3