From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mirko=20G=C3=BCnther?=
 <renegart@gmx.de>
Date: Sun, 8 Nov 2026 11:08:19 +0100
Subject: [PATCH 4/4] qqc2-suru/CMakeLists.txt: compile assets into the Qt 6
 plugin

qt_add_qml_module()'s RESOURCES expects resource files, not a .qrc
file, so only the .qrc itself was embedded and the QML files failed to
load their assets. Compile the .qrc with qt_add_resources() instead,
keeping the resource paths shared with the QMake build, and drop the
unused installation of the assets directory.
---
 qqc2-suru/CMakeLists.txt | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/qqc2-suru/CMakeLists.txt b/qqc2-suru/CMakeLists.txt
index 140e2df..6b02327 100644
--- a/qqc2-suru/CMakeLists.txt
+++ b/qqc2-suru/CMakeLists.txt
@@ -124,12 +124,14 @@ qt_add_qml_module(${PROJECT_NAME}
     OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_IMPORT_PATH}
     SOURCES ${PLUGIN_SOURCES} ${PLUGIN_HEADERS}
     QML_FILES ${QML_MAIN} ${QML_IMPL}
-    RESOURCES ${PROJECT_NAME}.qrc
 )
 
+qt_add_resources (PLUGIN_RESOURCES ${PROJECT_NAME}.qrc)
+
 target_sources (${PROJECT_NAME}
     PRIVATE
     qtquickcontrols2surustyleplugin.cpp
+    ${PLUGIN_RESOURCES}
 )
 
 target_compile_definitions(${PROJECT_NAME}
@@ -162,7 +164,3 @@ install (FILES
     ${QML_IMPL}
     DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_IMPORT_PATH}/impl
 )
-
-install (DIRECTORY assets
-    DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_IMPORT_PATH}/assets
-)
