diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-02-14 19:42:01 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-19 14:20:44 +0000 |
commit | e7e06083700f25f998989c8d95a02989f1a323ab (patch) | |
tree | ce36ffcbba593ec2b2865e2fc7f774d75a686e31 | |
parent | 21d2d228540d792c35b117091a17faf5ab52fb75 (diff) | |
download | qtwayland-e7e06083700f25f998989c8d95a02989f1a323ab.tar.gz |
Improve examples CMakeLists.txt
- 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
Change-Id: I3ce281ae1fb44c8d54ee09860ddadd3dbbdf7271
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 36b4ac5206dde6859a02df0db406ebca0eda5111)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
22 files changed, 78 insertions, 212 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bcfd4464..5f219b0c 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 c4553bdb..20ee212c 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 bdf9e124..99f12303 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 1826c745..8692dd6c 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 30012c74..eeacfd29 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 6d7688e6..256ade9b 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 8af9aeb3..1004a664 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 aab5a558..a6a7ced9 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 2fa09e7e..049d4ad2 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 d198c805..b78728ee 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 abc99d6b..e8d4efdd 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 6f9b0ac2..c960e966 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 0a4ee50d..c24b9e5d 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 df6357cc..f23f890b 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 97fd15e3..712d2feb 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 3be6e223..f008086d 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 c6d3b379..763dc2dc 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 751ebc0f..48a68e96 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 1d181a8e..d270106d 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 6787e3f7..5ecec45e 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 01895f42..391fd5f9 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 58d38f2f..2f276185 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" |