Hello, Ioan.
20.09.2016 12:35, Ioan Calin Borcoman пишет:
Adding to both the module and the project using it:
Depends { name: "Qt"; submodules: ["core", "network"]}
didn't solve the problem, unfortunately.
I have reported this as https://bugreports.qt.io/browse/QBS-1021.
Regarding your suggestion b), how can I do it? I haven't seen any qbs
examples returning multiple executables for the same rule. Also, from
what I understand, the "wsdl_foo.h" should be tagged as "hpp", while
the "wsdl_foo.cpp" as "cpp". Is my understanding correct? Can I do
this using a single rule? How?
I also had a similar problem on generation the soap- cpp/h files. I
managed to solve this problem.
I have attached an example of his QBS-module. Perhaps he will prompt you
how to solve the problem.
Thank you,
Ioan
On Tue, Sep 20, 2016 at 3:51 AM, Christian Kandeler
wrote:
Ioan Calin Borcoman wrote:
I'm trying to write a module that generates wsdl_foo.h and
wsdl_foo.cpp from foo.wsdl, using KDSoap's kdwsdl2cpp
(https://github.com/KDAB/KDSoap).
After it is generated, the wsdl_foo.h should be parsed by moc, as it
contains an QObject based class.
The problem is that moc is sometimes called and sometimes isn't. If I
delete the build tree and try to run qbs from scratch, the moc is not
run and the build fails.
But if I touch my kdsoap.qbs module, even if I don't change anything
in it, and then run again qbs, the moc is run and my project builds.
Two observations:
a) Your module does not have a Qt dependency. Does your product have one?
b) (Probably unrelated to your problem) It is confusing (though not technically
wrong) that you declare two rules. You should have only one rule that creates
two commands.
If your answer to a) is "yes", then please file a bug at bugreports.qt.io and
attach a complete (i.e. including source files), but minimal project.
Christian
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs
--
Best regards,
Pavel Karelin.
import qbs
import qbs.File
import qbs.TextFile
import qbs.ModUtils
Module {
id: gsoap
condition: true
Depends { name: "cpp" }
property string namespace: undefined
property string modulePath: ""
property string importPath: ""
property string soapcpp2: ""
property bool debug: false
property string generatedFilesDir: {
return product.buildDirectory + "/." + (namespace === undefined ? "soap" : namespace);
}
property string includePaths: {
return generatedFilesDir;
}
PropertyOptions {
name: "namespace"
description: "ÐпÑеделÑÐµÑ Ð¸Ð¼Ñ Ð¿ÑоÑÑÑанÑÑва имен Ð´Ð»Ñ ÑÑнкÑий soap-движка."
}
PropertyOptions {
name: "modulePath"
description: "ÐиÑекÑоÑÐ¸Ñ ÑаÑÐ¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ñайлов stdsoap2.h, stdsoap2.cpp"
}
PropertyOptions {
name: "importPath"
description: "ÐиÑекÑоÑÐ¸Ñ ÑаÑÐ¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ñайлов импоÑÑа gsoap"
}
PropertyOptions {
name: "soapcpp2"
description: "УÑилиÑа soapcpp2"
}
PropertyOptions {
name: "debug"
description: "СбоÑка в Ñежиме оÑладки"
}
PropertyOptions {
name: "generatedFilesDir"
description: "ÐиÑекÑоÑÐ¸Ñ ÑазмеÑÐµÐ½Ð¸Ñ ÑгенеÑиÑованнÑÑ
Ñайлов, Ñак же \
в ÑÑÑ Ð´Ð¸ÑекÑоÑÐ¸Ñ ÐºÐ¾Ð¿Ð¸ÑÑÑÑÑÑ ÑÐ°Ð¹Ð»Ñ stdsoap2.h, stdsoap2.cpp"
}
cpp.defines: {
var def = [
"WITH_COOKIES",
"WITH_GZIP",
"WITH_OPENSSL",
];
if (debug === true)
def.push("SOAP_DEBUG");
return def;
}
cpp.includePaths: {
return this.includePaths;
}
validate: {
var validator = new ModUtils.PropertyValidator("gsoap");
//validator.setRequiredProperty("namespace", namespace);
validator.setRequiredProperty("modulePath", modulePath);
validator.setRequiredProperty("importPath", importPath);
validator.setRequiredProperty("soapcpp2", soapcpp2);
validator.validate();
if (!File.exists(modulePath + "/stdsoap2.h"))
throw "Base soap-header file not found: " + modulePath + "/stdsoap2.h";
if (!File.exists(modulePath + "/stdsoap2.cpp"))
throw "Base soap-source file not found: " + modulePath + "/stdsoap2.cpp";
}
//FileTagger {
//patterns: ["*.wsdl"]
//fileTags: ["wsdl"]
//}
FileTagger {
patterns: "*.soap.h"
fileTags: ["soap"]
}
Rule {
inputs: ["soap"]
outputFileTags: ["cpp", "hpp"]
outputArtifacts: {
var generatedFilesDir = ModU