summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideo/CMakeLists.txt
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-02-14 18:26:21 +0100
committerKai Köhne <kai.koehne@qt.io>2022-02-17 16:54:43 +0100
commit236eec9cbe35f018f0c0617d4a0d707dea85b0ac (patch)
treefd0a00f3e3b4d74f85cd6ddf02b0639bc6f36834 /examples/multimedia/video/qmlvideo/CMakeLists.txt
parent470f05674a3afd52023441baf17dbad216e99d39 (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: I9f60da23df1547d685439b0263fa5bf533b7c69e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples/multimedia/video/qmlvideo/CMakeLists.txt')
-rw-r--r--examples/multimedia/video/qmlvideo/CMakeLists.txt19
1 files changed, 6 insertions, 13 deletions
diff --git a/examples/multimedia/video/qmlvideo/CMakeLists.txt b/examples/multimedia/video/qmlvideo/CMakeLists.txt
index 516f9b5c3..9ef73b090 100644
--- a/examples/multimedia/video/qmlvideo/CMakeLists.txt
+++ b/examples/multimedia/video/qmlvideo/CMakeLists.txt
@@ -1,25 +1,15 @@
-# Generated from qmlvideo.pro.
-
cmake_minimum_required(VERSION 3.16)
project(qmlvideo 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}/multimedia/video/qmlvideo")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Quick)
-find_package(Qt6 COMPONENTS Multimedia)
-find_package(Qt6 COMPONENTS Qml)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia Qml Quick)
qt_add_executable(qmlvideo
frequencymonitor.cpp frequencymonitor.h
@@ -29,6 +19,7 @@ qt_add_executable(qmlvideo
main.cpp
trace.h
)
+
set_target_properties(qmlvideo PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
@@ -50,17 +41,19 @@ target_link_libraries(qmlvideo PUBLIC
Qt::Quick
)
-
# Resources:
set_source_files_properties("images/folder.png"
PROPERTIES QT_RESOURCE_ALIAS "folder.png"
)
+
set_source_files_properties("images/leaves.jpg"
PROPERTIES QT_RESOURCE_ALIAS "leaves.jpg"
)
+
set_source_files_properties("images/up.png"
PROPERTIES QT_RESOURCE_ALIAS "up.png"
)
+
set(qmlvideo_resource_files
"images/folder.png"
"images/leaves.jpg"