File qlcplus5-git-qt6includedirs.patch of Package qlcplus5-git

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80941e0c9..a52b6ef6d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,6 +46,24 @@ find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)
 find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Multimedia MultimediaWidgets Network PrintSupport Qml Quick Svg Test Widgets LinguistTools)
 if(qmlui)
     find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS 3DCore 3DInput 3DQuick 3DQuickExtras 3DRender)
+
+    # Fix Debian OBS versioned include dirs
+    if(UNIX AND EXISTS "/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}/qt6")
+        message(STATUS "Applying Debian/OBS Qt6 3D include directory workaround")
+
+        foreach(_mod 3DCore 3DRender 3DInput 3DQuick AnimationExtras)
+            if(TARGET Qt6::${_mod})
+                get_target_property(_incs Qt6::${_mod} INTERFACE_INCLUDE_DIRECTORIES)
+                if(_incs MATCHES "/Qt3D[^/]+/[0-9]+\\.[0-9]+\\.[0-9]+")
+                    message(STATUS "Fixing Qt6::${_mod}")
+                    set_target_properties(Qt6::${_mod} PROPERTIES
+                        INTERFACE_INCLUDE_DIRECTORIES "/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}/qt6"
+                    )
+                endif()
+            endif()
+        endforeach()
+    endif()
+
     if(ANDROID)
         find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent OpenGL)
     endif()
openSUSE Build Service is sponsored by