diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-02-14 19:42:01 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-02-19 08:56:55 +0100 |
commit | 36b4ac5206dde6859a02df0db406ebca0eda5111 (patch) | |
tree | 429069b9e7157a7321c649aeefc0288509866ffe /examples/wayland/server-buffer | |
parent | 00323844defd67b0edc76db1c56ba32433a232bf (diff) |
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
Pick-to: 6.3
Change-Id: I3ce281ae1fb44c8d54ee09860ddadd3dbbdf7271
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/wayland/server-buffer')
-rw-r--r-- | examples/wayland/server-buffer/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/wayland/server-buffer/compositor/CMakeLists.txt | 18 | ||||
-rw-r--r-- | examples/wayland/server-buffer/cpp-client/CMakeLists.txt | 17 |
3 files changed, 10 insertions, 27 deletions
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 |