summaryrefslogtreecommitdiffstats
path: root/examples/charts/qmlweather/CMakeLists.txt
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 16:06:13 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-21 10:29:57 +0000
commit93c907e882aa7de6c1d77b6d049ac35f11cd5be2 (patch)
tree4a540a3b7bd2dca8934c5145621b5ec580808f16 /examples/charts/qmlweather/CMakeLists.txt
parent29854ec6633310ca568d9b9df24939482fff22bf (diff)
Improve examples CMakeLists.txt
- Remove # generated from xyz.pro comment from pro2cmake - Remove "# special case" markers for 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 Change-Id: Ia419531218b14a97699efcc4d6e41115c37ea83d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit a3ec2015794bc58a37b0017d86ba27d24987ff92) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/charts/qmlweather/CMakeLists.txt')
-rw-r--r--examples/charts/qmlweather/CMakeLists.txt17
1 files changed, 4 insertions, 13 deletions
diff --git a/examples/charts/qmlweather/CMakeLists.txt b/examples/charts/qmlweather/CMakeLists.txt
index 8142fb8c..10f6ea56 100644
--- a/examples/charts/qmlweather/CMakeLists.txt
+++ b/examples/charts/qmlweather/CMakeLists.txt
@@ -1,33 +1,25 @@
-# Generated from qmlweather.pro.
-
cmake_minimum_required(VERSION 3.16)
project(qmlweather 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}/charts/qmlweather")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Charts)
-find_package(Qt6 COMPONENTS Qml)
-find_package(Qt6 COMPONENTS Quick)
+find_package(Qt6 REQUIRED COMPONENTS Charts Core Gui Qml Quick)
qt_add_executable(qmlweather
main.cpp
)
+
set_target_properties(qmlweather PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(qmlweather PUBLIC
Qt::Charts
Qt::Core
@@ -36,7 +28,6 @@ target_link_libraries(qmlweather PUBLIC
Qt::Quick
)
-
# Resources:
set(resources_resource_files
"qml/qmlweather/main.qml"