summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 16:14:26 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-21 10:25:16 +0100
commit995779435381bbdc63f80a0a0c8fa709a4c92362 (patch)
tree0ab622796f06da06343f156ccd07555b81efc6ce /examples/bluetooth/lowenergyscanner
parente91c9ce06c92df424e2fd6d8acda1a4eda843923 (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/lowenergyscanner')
-rw-r--r--examples/bluetooth/lowenergyscanner/CMakeLists.txt14
1 files changed, 4 insertions, 10 deletions
diff --git a/examples/bluetooth/lowenergyscanner/CMakeLists.txt b/examples/bluetooth/lowenergyscanner/CMakeLists.txt
index 64a41e8d..41a6a7a9 100644
--- a/examples/bluetooth/lowenergyscanner/CMakeLists.txt
+++ b/examples/bluetooth/lowenergyscanner/CMakeLists.txt
@@ -1,22 +1,15 @@
cmake_minimum_required(VERSION 3.16)
project(lowenergyscanner 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/lowenergyscanner")
-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(lowenergyscanner
characteristicinfo.cpp characteristicinfo.h
@@ -25,10 +18,12 @@ qt_add_executable(lowenergyscanner
main.cpp
serviceinfo.cpp serviceinfo.h
)
+
set_target_properties(lowenergyscanner PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_include_directories(lowenergyscanner PUBLIC
.
)
@@ -54,7 +49,6 @@ if (APPLE)
endif()
endif()
-
# Resources:
set(resources_resource_files
"assets/Characteristics.qml"