diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-09 16:00:59 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-11 15:18:17 +0200 |
commit | 64b51ff6cc1dfc4e6af50d85b8cdef510d724f25 (patch) | |
tree | 986c4b2dcade3c47dd8bb99713addabd2f265cc9 /src/lib/qtprofilesetup/templates | |
parent | d51dddb4aefa72b2c3a662bb112c41c024a2288c (diff) |
libqtprofilesetup: Gather information about Qt plugins.
And create modules for them. These also handle the creation
of the "import" source file when building against a static Qt.
Change-Id: I883a1dd96c5e38c9d4bb5c13af807b1bf388f8b1
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/qtprofilesetup/templates')
-rw-r--r-- | src/lib/qtprofilesetup/templates/QtModule.qbs | 1 | ||||
-rw-r--r-- | src/lib/qtprofilesetup/templates/QtPlugin.qbs | 31 | ||||
-rw-r--r-- | src/lib/qtprofilesetup/templates/gui.qbs | 1 | ||||
-rw-r--r-- | src/lib/qtprofilesetup/templates/plugin.qbs | 23 |
4 files changed, 56 insertions, 0 deletions
diff --git a/src/lib/qtprofilesetup/templates/QtModule.qbs b/src/lib/qtprofilesetup/templates/QtModule.qbs index c6a1aae49..32ccc6a2e 100644 --- a/src/lib/qtprofilesetup/templates/QtModule.qbs +++ b/src/lib/qtprofilesetup/templates/QtModule.qbs @@ -19,6 +19,7 @@ Module { property string qtVersion: Qt.core.version property bool hasLibrary: true property bool isStaticLibrary: false + property bool isPlugin: false property stringList staticLibsDebug property stringList staticLibsRelease diff --git a/src/lib/qtprofilesetup/templates/QtPlugin.qbs b/src/lib/qtprofilesetup/templates/QtPlugin.qbs new file mode 100644 index 000000000..86fd9ff81 --- /dev/null +++ b/src/lib/qtprofilesetup/templates/QtPlugin.qbs @@ -0,0 +1,31 @@ +import qbs 1.0 +import qbs.FileInfo +import qbs.TextFile + +QtModule { + isPlugin: true + + property string className + + Transformer { + condition: isStaticLibrary + Artifact { + fileName: product.targetName + "_qt_plugin_import_" + + parent.parent.qtModuleName + ".cpp" + fileTags: "cpp" + } + + prepare: { + var cmd = new JavaScriptCommand(); + var pluginName = product.moduleProperty(product.moduleName, "qtModuleName"); + cmd.description = "Creating static import for plugin '" + pluginName + "'."; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + var className = product.moduleProperty(product.moduleName, "className"); + f.writeLine("#include <QtPlugin>\n\nQ_IMPORT_PLUGIN(" + className + ")"); + f.close(); + }; + return cmd; + } + } +} diff --git a/src/lib/qtprofilesetup/templates/gui.qbs b/src/lib/qtprofilesetup/templates/gui.qbs index e2d91598e..958d69571 100644 --- a/src/lib/qtprofilesetup/templates/gui.qbs +++ b/src/lib/qtprofilesetup/templates/gui.qbs @@ -32,6 +32,7 @@ QtModule { } } + property string defaultQpaPlugin: @defaultQpaPlugin@ staticLibsDebug: @staticLibsDebug@ staticLibsRelease: @staticLibsRelease@ dynamicLibsDebug: @dynamicLibsDebug@ diff --git a/src/lib/qtprofilesetup/templates/plugin.qbs b/src/lib/qtprofilesetup/templates/plugin.qbs new file mode 100644 index 000000000..7149b3898 --- /dev/null +++ b/src/lib/qtprofilesetup/templates/plugin.qbs @@ -0,0 +1,23 @@ +import qbs 1.0 +import '../QtPlugin.qbs' as QtPlugin + +QtPlugin { + qtModuleName: @name@ + Depends { name: "Qt"; submodules: @dependencies@} + + className: @className@ + staticLibsDebug: @staticLibsDebug@ + staticLibsRelease: @staticLibsRelease@ + dynamicLibsDebug: @dynamicLibsDebug@ + dynamicLibsRelease: @dynamicLibsRelease@ + linkerFlagsDebug: @linkerFlagsDebug@ + linkerFlagsRelease: @linkerFlagsRelease@ + frameworksDebug: @frameworksDebug@ + frameworksRelease: @frameworksRelease@ + frameworkPathsDebug: @frameworkPathsDebug@ + frameworkPathsRelease: @frameworkPathsRelease@ + libNameForLinkerDebug: @libNameForLinkerDebug@ + libNameForLinkerRelease: @libNameForLinkerRelease@ + cpp.libraryPaths: @libraryPaths@ + @special_properties@ +} |