summaryrefslogtreecommitdiffstats
path: root/examples/serialport/cenumerator/CMakeLists.txt
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 19:27:10 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-21 10:24:42 +0100
commit7364adf4725a044819ab50ce55f82ad522f9c442 (patch)
tree79ac602a1a4726f752ed6baec014facfbcb1f27b /examples/serialport/cenumerator/CMakeLists.txt
parentb9bad5bce1929fdadbc9872f90c68116c7aef710 (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: I024f0c99756c2583a867022b8478f06e088a39af Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/serialport/cenumerator/CMakeLists.txt')
-rw-r--r--examples/serialport/cenumerator/CMakeLists.txt11
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/serialport/cenumerator/CMakeLists.txt b/examples/serialport/cenumerator/CMakeLists.txt
index b3a4a1f4..1270e06f 100644
--- a/examples/serialport/cenumerator/CMakeLists.txt
+++ b/examples/serialport/cenumerator/CMakeLists.txt
@@ -1,28 +1,25 @@
cmake_minimum_required(VERSION 3.16)
project(cenumerator 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}/serialport/cenumerator")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS SerialPort)
+find_package(Qt6 REQUIRED COMPONENTS Core SerialPort)
qt_add_executable(cenumerator
main.cpp
)
+
set_target_properties(cenumerator PROPERTIES
WIN32_EXECUTABLE FALSE
MACOSX_BUNDLE FALSE
)
+
target_link_libraries(cenumerator PRIVATE
Qt::Core
Qt::SerialPort