aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-10-17 12:20:01 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2016-10-20 15:33:38 +0000
commitd07c24c701963ac0eaf1e7fb1774efcf2ee4dee3 (patch)
treeba12bff89306ad9e13f110b182a7c2b272c26303 /src
parent91242e37603bab2c2adcfbc34fd9731b668ae6f6 (diff)
Add support for the QtScxml module
[ChangeLog] Added support for QtScxml module. Change-Id: I1ad8d51a3d9532d4a24270e4cc13f26f51620b07 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/lib/qtprofilesetup/qtprofilesetup.cpp2
-rw-r--r--src/lib/qtprofilesetup/templates.qrc1
-rw-r--r--src/lib/qtprofilesetup/templates/scxml.qbs68
3 files changed, 71 insertions, 0 deletions
diff --git a/src/lib/qtprofilesetup/qtprofilesetup.cpp b/src/lib/qtprofilesetup/qtprofilesetup.cpp
index ca45bfa86..23aa658af 100644
--- a/src/lib/qtprofilesetup/qtprofilesetup.cpp
+++ b/src/lib/qtprofilesetup/qtprofilesetup.cpp
@@ -222,6 +222,8 @@ static void createModules(Profile &profile, Settings *settings,
&allFiles);
} else if (module.qbsName == QLatin1String("gui")) {
moduleTemplateFileName = QLatin1String("gui.qbs");
+ } else if (module.qbsName == QLatin1String("scxml")) {
+ moduleTemplateFileName = QLatin1String("scxml.qbs");
} else if (module.qbsName == QLatin1String("dbus")) {
moduleTemplateFileName = QLatin1String("dbus.qbs");
copyTemplateFile(QLatin1String("dbus.js"), qbsQtModuleDir, profile, qtEnvironment,
diff --git a/src/lib/qtprofilesetup/templates.qrc b/src/lib/qtprofilesetup/templates.qrc
index 257e89a54..bcbf2bd67 100644
--- a/src/lib/qtprofilesetup/templates.qrc
+++ b/src/lib/qtprofilesetup/templates.qrc
@@ -11,5 +11,6 @@
<file>templates/QtPlugin.qbs</file>
<file>templates/dbus.js</file>
<file>templates/dbus.qbs</file>
+ <file>templates/scxml.qbs</file>
</qresource>
</RCC>
diff --git a/src/lib/qtprofilesetup/templates/scxml.qbs b/src/lib/qtprofilesetup/templates/scxml.qbs
new file mode 100644
index 000000000..206d914a2
--- /dev/null
+++ b/src/lib/qtprofilesetup/templates/scxml.qbs
@@ -0,0 +1,68 @@
+import qbs 1.0
+import qbs.FileInfo
+import "../QtModule.qbs" as QtModule
+
+QtModule {
+ qtModuleName: "Scxml"
+
+ property string qscxmlcName: "qscxmlc"
+ property string className
+ property string namespace
+
+ Rule {
+ inputs: ["qt.scxml.compilable"]
+
+ Artifact {
+ filePath: FileInfo.joinPaths(product.moduleProperty("Qt.core", "generatedHeadersDir"),
+ input.baseName + ".h")
+ fileTags: ["hpp", "unmocable"]
+ }
+ Artifact {
+ filePath: input.baseName + ".cpp"
+ fileTags: ["cpp"]
+ }
+
+ prepare: {
+ var compilerName = product.moduleProperty("Qt.scxml", "qscxmlcName");
+ var compilerPath = FileInfo.joinPaths(input.moduleProperty("Qt.core", "binPath"),
+ compilerName);
+ var args = ["--header", outputs["hpp"][0].filePath,
+ "--impl", outputs["cpp"][0].filePath];
+ var cxx98 = input.moduleProperty("cpp", "cxxLanguageVersion") === "c++98";
+ if (cxx98)
+ args.push("-no-c++11");
+ var className = input.moduleProperty("Qt.scxml", "className");
+ if (className)
+ args.push("--classname", className);
+ var namespace = input.moduleProperty("Qt.scxml", "namespace");
+ if (namespace)
+ args.push("--namespace", namespace);
+ args.push(input.filePath);
+ var cmd = new Command(compilerPath, args);
+ cmd.description = "compiling " + input.fileName;
+ cmd.highlight = "codegen";
+ return [cmd];
+ }
+ }
+
+ staticLibsDebug: @staticLibsDebug@
+ staticLibsRelease: @staticLibsRelease@
+ dynamicLibsDebug: @dynamicLibsDebug@
+ dynamicLibsRelease: @dynamicLibsRelease@
+ linkerFlagsDebug: @linkerFlagsDebug@
+ linkerFlagsRelease: @linkerFlagsRelease@
+ frameworksDebug: @frameworksDebug@
+ frameworksRelease: @frameworksRelease@
+ frameworkPathsDebug: @frameworkPathsDebug@
+ frameworkPathsRelease: @frameworkPathsRelease@
+ libNameForLinkerDebug: @libNameForLinkerDebug@
+ libNameForLinkerRelease: @libNameForLinkerRelease@
+ libFilePathDebug: @libFilePathDebug@
+ libFilePathRelease: @libFilePathRelease@
+
+ cpp.defines: @defines@
+ cpp.includePaths: @includes@
+ cpp.libraryPaths: @libraryPaths@
+
+ @special_properties@
+}