summaryrefslogtreecommitdiffstats
path: root/examples/sensors/sensor_explorer/CMakeLists.txt
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 19:15:29 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-21 10:24:46 +0100
commite318718f9ddd12f9328df249ae1b8f73b33f431c (patch)
tree2129c3eebf1d09d39af2a9be1b7aff89137d16fa /examples/sensors/sensor_explorer/CMakeLists.txt
parent041427535851f61e6db845ada3ea771eb89ac63b (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: Ie7432614f6060152eb3278724877670059c71495 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/sensors/sensor_explorer/CMakeLists.txt')
-rw-r--r--examples/sensors/sensor_explorer/CMakeLists.txt9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/sensors/sensor_explorer/CMakeLists.txt b/examples/sensors/sensor_explorer/CMakeLists.txt
index 9f37faba..db0d95dc 100644
--- a/examples/sensors/sensor_explorer/CMakeLists.txt
+++ b/examples/sensors/sensor_explorer/CMakeLists.txt
@@ -1,19 +1,15 @@
cmake_minimum_required(VERSION 3.16)
project(sensor_explorer 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}/sensors/sensor_explorer")
-find_package(Qt6 COMPONENTS Qml Quick Sensors)
+find_package(Qt6 REQUIRED COMPONENTS Qml Quick Sensors)
qt_add_executable(sensor_explorer
main.cpp
@@ -24,6 +20,7 @@ set_target_properties(sensor_explorer PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(sensor_explorer PUBLIC
Qt::Qml
Qt::Quick