diff options
author | Samuel Mira <samuel.mira@qt.io> | 2022-03-07 18:50:08 +0200 |
---|---|---|
committer | Samuel Mira <samuel.mira@qt.io> | 2022-03-09 16:47:59 +0200 |
commit | bdacf2b290e9d341ffc5d96e7bcc696ef3b7add7 (patch) | |
tree | c43cf588ce91070576007ed3c7ee7eb1135d746c /examples/multimedia/video/mediaplayer/CMakeLists.txt | |
parent | 35fefad005015f2c0147e4d0f34d30754417dc5c (diff) |
Fix missing main.qml in examples
These examples use resources files with qml files inside but the
resource files were added in the project sources. That prevented
the app to find and use the resource files. To fix the issue the
resources were added using qt6_add_resources macro.
Note that adding the cmake flag set(CMAKE_AUTORCC ON) would also
work, but the qt6_add_resources macro is more consistent with the
rest of the examples.
Fixes: QTBUG-101518
Pick-to: 6.3
Change-Id: I5fb2481d5576683171a2292bdc35e417ee6d8fab
Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'examples/multimedia/video/mediaplayer/CMakeLists.txt')
-rw-r--r-- | examples/multimedia/video/mediaplayer/CMakeLists.txt | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/examples/multimedia/video/mediaplayer/CMakeLists.txt b/examples/multimedia/video/mediaplayer/CMakeLists.txt index f9e29d1fd..1c70197af 100644 --- a/examples/multimedia/video/mediaplayer/CMakeLists.txt +++ b/examples/multimedia/video/mediaplayer/CMakeLists.txt @@ -30,16 +30,31 @@ find_package(Qt6 REQUIRED COMPONENTS Core Quick QuickControls2 Svg) set(PROJECT_SOURCES main.cpp - qml.qrc ) qt_add_executable(mediaplayer ${PROJECT_SOURCES} ) +set(resource_files + "main.qml" + "PlaybackControl.qml" + "MetadataInfo.qml" + "AudioControl.qml" + "PlaybackSeekControl.qml" + "PlaybackRateControl.qml" + "PlayerMenuBar.qml" + "TracksInfo.qml" + "Mute_Icon.svg" + "Speaker_Icon.svg" +) + qt6_add_resources(mediaplayer "mediaplayer" - PREFIX "/" - FILES "Mute_Icon.svg" "Speaker_Icon.svg") + PREFIX + "/" + FILES + ${resource_files} +) target_compile_definitions(mediaplayer PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>) |