diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-02-14 16:14:26 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-02-21 10:25:16 +0100 |
commit | 995779435381bbdc63f80a0a0c8fa709a4c92362 (patch) | |
tree | 0ab622796f06da06343f156ccd07555b81efc6ce /examples/bluetooth/pingpong | |
parent | e91c9ce06c92df424e2fd6d8acda1a4eda843923 (diff) |
Improve examples CMakeLists.txt
- 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: If1935beb09edd873c45842ae06d0f41267a9b36a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/bluetooth/pingpong')
-rw-r--r-- | examples/bluetooth/pingpong/CMakeLists.txt | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/examples/bluetooth/pingpong/CMakeLists.txt b/examples/bluetooth/pingpong/CMakeLists.txt index c406ab3f..914b9ba8 100644 --- a/examples/bluetooth/pingpong/CMakeLists.txt +++ b/examples/bluetooth/pingpong/CMakeLists.txt @@ -1,32 +1,27 @@ cmake_minimum_required(VERSION 3.16) project(btpingpong 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}/bluetooth/pingpong") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Bluetooth) +find_package(Qt6 REQUIRED COMPONENTS Bluetooth Core Gui Quick) qt_add_executable(btpingpong main.cpp pingpong.cpp pingpong.h ) + set_target_properties(btpingpong PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE OUTPUT_NAME "pingpong" ) + target_link_libraries(btpingpong PUBLIC Qt::Bluetooth Qt::Core @@ -34,7 +29,6 @@ target_link_libraries(btpingpong PUBLIC Qt::Quick ) - # Resources: set(resource_resource_files "assets/Board.qml" |