summaryrefslogtreecommitdiffstats
path: root/examples/serialport/blockingsender
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/blockingsender
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/blockingsender')
-rw-r--r--examples/serialport/blockingsender/CMakeLists.txt13
1 files changed, 4 insertions, 9 deletions
diff --git a/examples/serialport/blockingsender/CMakeLists.txt b/examples/serialport/blockingsender/CMakeLists.txt
index 90d8014f..f2459324 100644
--- a/examples/serialport/blockingsender/CMakeLists.txt
+++ b/examples/serialport/blockingsender/CMakeLists.txt
@@ -1,32 +1,27 @@
cmake_minimum_required(VERSION 3.16)
project(blockingsender 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/blockingsender")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS SerialPort)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui SerialPort Widgets)
qt_add_executable(blockingsender
dialog.cpp dialog.h
main.cpp
senderthread.cpp senderthread.h
)
+
set_target_properties(blockingsender PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(blockingsender PRIVATE
Qt::Core
Qt::Gui