aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-04-23 15:46:40 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-04-23 14:40:02 +0000
commit69f7865c72174c2ea8b9af1429439fe0f9ecb914 (patch)
tree7285691618400d954e55a5b00acd35047c44feb2 /src/tools
parente915cde44bd72c2fb8a013ea0ae43cf32b7af98f (diff)
qml2puppet: Enhance qbs build
Add the optional QtQuick3D dependency that was so far only in the qmake project file. Also fix annoying moc warnings for builds without QtQuick3D. Change-Id: Ic0f4f3de5b4a5d715332166d7390ad027dd377ed Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qml2puppet/qml2puppet.qbs35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/tools/qml2puppet/qml2puppet.qbs b/src/tools/qml2puppet/qml2puppet.qbs
index 8a264579012..ccc85fcc7c9 100644
--- a/src/tools/qml2puppet/qml2puppet.qbs
+++ b/src/tools/qml2puppet/qml2puppet.qbs
@@ -1,4 +1,4 @@
-import qbs
+import qbs.Utilities
import QtcFunctions
QtcTool {
@@ -15,7 +15,16 @@ QtcTool {
"widgets"
]
}
- cpp.defines: base.filter(function(d) { return d != "QT_CREATOR"; })
+ Depends { name: "Qt.quick3d-private"; required: false }
+ property bool useQuick3d: Utilities.versionCompare(Qt.core.version, "5.15") >= 0
+ && Qt["quick3d-private"].present
+
+ cpp.defines: {
+ var defines = base.filter(function(d) { return d != "QT_CREATOR"; });
+ if (useQuick3d)
+ defines.push("QUICK3D_MODULE");
+ return defines;
+ }
Properties {
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("bsd")
cpp.dynamicLibraries: base.concat("rt")
@@ -204,25 +213,33 @@ QtcTool {
"instances/servernodeinstance.cpp",
"instances/servernodeinstance.h",
"editor3d/generalhelper.cpp",
- "editor3d/generalhelper.h",
"editor3d/mousearea3d.cpp",
- "editor3d/mousearea3d.h",
"editor3d/camerageometry.cpp",
- "editor3d/camerageometry.h",
"editor3d/lightgeometry.cpp",
- "editor3d/lightgeometry.h",
"editor3d/gridgeometry.cpp",
- "editor3d/gridgeometry.h",
"editor3d/selectionboxgeometry.cpp",
- "editor3d/selectionboxgeometry.h",
"editor3d/linegeometry.cpp",
- "editor3d/linegeometry.h",
"editor3d/icongizmoimageprovider.cpp",
"editor3d/icongizmoimageprovider.h",
"iconrenderer/iconrenderer.cpp",
"iconrenderer/iconrenderer.h",
"qml2puppetmain.cpp",
]
+
+ Group {
+ name: "3d-only puppet2 headers"
+ files: [
+ "editor3d/camerageometry.h",
+ "editor3d/generalhelper.h",
+ "editor3d/gridgeometry.h",
+ "editor3d/lightgeometry.h",
+ "editor3d/linegeometry.h",
+ "editor3d/selectionboxgeometry.h",
+ "editor3d/mousearea3d.h",
+ ]
+ fileTags: product.useQuick3d ? [] : ["unmocable"]
+ overrideTags: false
+ }
}
Group {