diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-02-14 19:11:27 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-02-21 09:46:15 +0100 |
commit | 7f64390b777170ecdd285508b0fa6978db61cf66 (patch) | |
tree | b9ff7d4ee70def4be8e35e92a27479b2c3b60e4f /examples/scxml/pinball/CMakeLists.txt | |
parent | be4f54e375fe141069faaf551f5873de8d7eecaa (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: Iaf7286069494041e90a59cedeae30ef26713d538
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/scxml/pinball/CMakeLists.txt')
-rw-r--r-- | examples/scxml/pinball/CMakeLists.txt | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/examples/scxml/pinball/CMakeLists.txt b/examples/scxml/pinball/CMakeLists.txt index 1966d38..04dfe2f 100644 --- a/examples/scxml/pinball/CMakeLists.txt +++ b/examples/scxml/pinball/CMakeLists.txt @@ -1,33 +1,27 @@ -# Generated from pinball.pro. - cmake_minimum_required(VERSION 3.16) project(pinball 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}/scxml/pinball") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS Scxml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Scxml Widgets) qt_add_executable(pinball main.cpp mainwindow.cpp mainwindow.h mainwindow.ui ) + set_target_properties(pinball PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(pinball PUBLIC Qt::Core Qt::Gui @@ -35,7 +29,6 @@ target_link_libraries(pinball PUBLIC Qt::Widgets ) - # Statecharts: qt6_add_statecharts(pinball pinball.scxml |