From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Wed, 1 Jul 2026 16:12:11 +0200
Subject: [PATCH 1/4] qqc2-suru/CMakeLists.txt: Fix ElevationEffect path in
 generated qmldir file

Need to set QT_RESOURCE_ALIAS property on files pulled from Qt-version-specific dirs, otherwise the generated qmldir file has
"qml-qt6/impl/..." instead of just "impl/...".

(cherry picked from commit 707abe4120fc255d4c12e2ae598b73eccc43c30c)
---
 qqc2-suru/CMakeLists.txt | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/qqc2-suru/CMakeLists.txt b/qqc2-suru/CMakeLists.txt
index a21df0f..c41ebad 100644
--- a/qqc2-suru/CMakeLists.txt
+++ b/qqc2-suru/CMakeLists.txt
@@ -2,14 +2,16 @@ project (qtquickcontrols2surustyleplugin)
 set (PLUGIN_URI "QtQuick.Controls.Suru")
 set (PLUGIN_VERSION "2.2")
 
-list (APPEND QML_IMPL
+list (APPEND QML_IMPL_SHARED
     impl/CheckIndicator.qml
     impl/CursorDelegate.qml
-    qml-qt${QT_MAJOR_VERSION}/impl/ElevationEffect.qml
     impl/HighlightFocusRectangle.qml
     impl/RadioIndicator.qml
     impl/SwitchIndicator.qml
 )
+list (APPEND QML_IMPL_QTSPECIFIC
+    impl/ElevationEffect.qml
+)
 
 list (APPEND QML_MAIN
     ApplicationWindow.qml
@@ -89,6 +91,18 @@ endif()
 
 string (REPLACE "." "/" PLUGIN_IMPORT_PATH "${PLUGIN_URI}")
 
+set (QML_IMPL ${QML_IMPL_SHARED})
+foreach (QML_IMPL_QTSPECIFIC_FILE IN LISTS QML_IMPL_QTSPECIFIC)
+    # Actual location
+    set (QML_IMPL_QTSPECIFIC_PATH "qml-qt${QT_MAJOR_VERSION}/${QML_IMPL_QTSPECIFIC_FILE}")
+
+    # Make sure qmldir file gets the name under which it will actually be installed
+    set_source_files_properties (${QML_IMPL_QTSPECIFIC_PATH} PROPERTIES QT_RESOURCE_ALIAS ${QML_IMPL_QTSPECIFIC_FILE})
+
+    # Add it to list of impl files
+    list (APPEND QML_IMPL ${QML_IMPL_QTSPECIFIC_PATH})
+endforeach()
+
 qt_add_qml_module(${PROJECT_NAME}
     URI ${PLUGIN_URI}
     VERSION ${PLUGIN_VERSION}
