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/invoke-static | |
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/invoke-static')
-rw-r--r-- | examples/scxml/invoke-static/CMakeLists.txt | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/examples/scxml/invoke-static/CMakeLists.txt b/examples/scxml/invoke-static/CMakeLists.txt index cf162b7..5e4130e 100644 --- a/examples/scxml/invoke-static/CMakeLists.txt +++ b/examples/scxml/invoke-static/CMakeLists.txt @@ -1,29 +1,25 @@ -# Generated from invoke-static.pro. - cmake_minimum_required(VERSION 3.16) project(invoke-static 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/invoke-static") -find_package(Qt6 COMPONENTS Core Gui Qml Scxml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Scxml) qt_add_executable(invoke-static invoke-static.cpp ) + set_target_properties(invoke-static PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(invoke-static PUBLIC Qt6::Core Qt6::Gui @@ -35,12 +31,15 @@ target_link_libraries(invoke-static PUBLIC set_source_files_properties("../invoke-common/Button.qml" PROPERTIES QT_RESOURCE_ALIAS "Button.qml" ) + set_source_files_properties("../invoke-common/MainView.qml" PROPERTIES QT_RESOURCE_ALIAS "MainView.qml" ) + set_source_files_properties("../invoke-common/SubView.qml" PROPERTIES QT_RESOURCE_ALIAS "SubView.qml" ) + set(invoke-static_resource_files "../invoke-common/Button.qml" "../invoke-common/MainView.qml" @@ -55,7 +54,6 @@ qt6_add_resources(invoke-static "invoke-static" ${invoke-static_resource_files} ) - # Statecharts: qt6_add_statecharts(invoke-static ../invoke-common/statemachine.scxml |