summaryrefslogtreecommitdiffstats
path: root/examples/serialbus/can/CMakeLists.txt
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 19:25:00 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-17 15:08:02 +0100
commit8429fc2d637faadadca63e1496a98ae03e62fc05 (patch)
tree21e390c3714cfcec332a849c8aada009fe143744 /examples/serialbus/can/CMakeLists.txt
parentb752dcb14fba329bb43d3fb204fda1898b719122 (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 where not necessary - 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: I66b7edaf699db528ed91f738a009aaa2423e3d80 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/serialbus/can/CMakeLists.txt')
-rw-r--r--examples/serialbus/can/CMakeLists.txt12
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/serialbus/can/CMakeLists.txt b/examples/serialbus/can/CMakeLists.txt
index b8a01af..34ec667 100644
--- a/examples/serialbus/can/CMakeLists.txt
+++ b/examples/serialbus/can/CMakeLists.txt
@@ -4,20 +4,15 @@ project(can 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}/serialbus/can")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Network)
-find_package(Qt6 COMPONENTS SerialBus)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Network SerialBus Widgets)
qt_add_executable(can
bitratebox.cpp bitratebox.h
@@ -30,10 +25,12 @@ qt_add_executable(can
receivedframesmodel.cpp receivedframesmodel.h
receivedframesview.cpp receivedframesview.h
)
+
set_target_properties(can PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(can PUBLIC
Qt::Core
Qt::Gui
@@ -42,7 +39,6 @@ target_link_libraries(can PUBLIC
Qt::Widgets
)
-
# Resources:
set(can_resource_files
"images/application-exit.png"