Description: Fix include paths exported to dependent products
 The include paths exported by the libtiled, qtsingleapplication,
 qtpropertybrowser, karchive and libtilededitor products were given as
 relative paths. With qbs >= 2 such paths are resolved relative to the
 importing product, so the dependent products (Plugins, tmxviewer,
 tmxrasterizer, terraingenerator, tests) were pointed at their own source
 directory instead of the directory providing the headers. moc then failed
 with "Error: Undefined interface" on the plugin headers and compilation of
 the plugin sources could not find headers like mapformat.h. Export the
 paths as absolute paths derived from project.sourceDirectory instead.
Author: openKylin Bot <openKylinBot@openkylin.top>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-10-20

--- tiled-qt-1.11.90.orig/src/karchive/karchive.qbs
+++ tiled-qt-1.11.90/src/karchive/karchive.qbs
@@ -1,3 +1,5 @@
+import qbs.FileInfo
+
 StaticLibrary {
     condition: !qbs.toolchain.contains("msvc")
 
@@ -54,7 +56,8 @@ StaticLibrary {
 
     Export {
         Depends { name: "cpp" }
-        cpp.includePaths: "src"
+        // Absolute path, see the comment in src/libtiled/libtiled.qbs.
+        cpp.includePaths: FileInfo.joinPaths(project.sourceDirectory, "src/karchive/src")
         cpp.defines: [
             "KARCHIVE_NO_DEPRECATED",
             "KARCHIVE_STATIC_DEFINE",
--- tiled-qt-1.11.90.orig/src/libtiled/libtiled.qbs
+++ tiled-qt-1.11.90/src/libtiled/libtiled.qbs
@@ -1,3 +1,4 @@
+import qbs.FileInfo
 import qbs.Probes as Probes
 
 DynamicLibrary {
@@ -199,7 +200,11 @@ DynamicLibrary {
             submodules: ["gui"]
         }
 
-        cpp.includePaths: "."
+        // The include path is exported as an absolute path on purpose: with
+        // qbs >= 2 a relative path in an exported module property is resolved
+        // relative to the *importing* product, which pointed the dependents
+        // (plugins, tools, tests) at their own directory instead of this one.
+        cpp.includePaths: FileInfo.joinPaths(project.sourceDirectory, "src/libtiled")
     }
 
     install: !qbs.targetOS.contains("darwin")
--- tiled-qt-1.11.90.orig/src/qtpropertybrowser/qtpropertybrowser.qbs
+++ tiled-qt-1.11.90/src/qtpropertybrowser/qtpropertybrowser.qbs
@@ -1,3 +1,5 @@
+import qbs.FileInfo
+
 StaticLibrary {
     name: "qtpropertybrowser"
 
@@ -41,6 +43,7 @@ StaticLibrary {
 
     Export {
         Depends { name: "cpp" }
-        cpp.includePaths: "src"
+        // Absolute path, see the comment in src/libtiled/libtiled.qbs.
+        cpp.includePaths: FileInfo.joinPaths(project.sourceDirectory, "src/qtpropertybrowser/src")
     }
 }
--- tiled-qt-1.11.90.orig/src/qtsingleapplication/qtsingleapplication.qbs
+++ tiled-qt-1.11.90/src/qtsingleapplication/qtsingleapplication.qbs
@@ -1,3 +1,5 @@
+import qbs.FileInfo
+
 StaticLibrary {
     name: "qtsingleapplication"
 
@@ -26,6 +28,7 @@ StaticLibrary {
     Export {
         Depends { name: "cpp" }
         Depends { name: "Qt.widgets" }
-        cpp.includePaths: "src"
+        // Absolute path, see the comment in src/libtiled/libtiled.qbs.
+        cpp.includePaths: FileInfo.joinPaths(project.sourceDirectory, "src/qtsingleapplication/src")
     }
 }
--- tiled-qt-1.11.90.orig/src/tiled/libtilededitor.qbs
+++ tiled-qt-1.11.90/src/tiled/libtilededitor.qbs
@@ -618,7 +618,8 @@ DynamicLibrary {
         Depends { name: "libtiled" }
         Depends { name: "qtsingleapplication" }
         Depends { name: "Qt"; submodules: ["qml"] }
-        cpp.includePaths: "."
+        // Absolute path, see the comment in src/libtiled/libtiled.qbs.
+        cpp.includePaths: FileInfo.joinPaths(project.sourceDirectory, "src/tiled")
     }
 
     install: !qbs.targetOS.contains("darwin")
