[Qbs] A simple project that copy an executable does not work
Vincent Hui
vincenthk007 at gmail.com
Sat Jul 6 15:29:33 CEST 2019
Hi Richard,
Thank you very much for your reply.
I am creating toy projects for learning how to use qbs.
In the document of Rule, A simple example is not a complete example. It
does not tell user to assign the product type to "txt_output" explicitly.
I hope the document can be improved in the future.
Thank you again,
Vincent
On Sat, 6 Jul 2019 at 19:40, Richard Weickelt <richard at weickelt.de> wrote:
> > I created a simple project to copy an executable generated by
> > CppApplication. However the executable is not copied.
> >
> > I cannot figure out why? Can anyone tell me why?
>
> Please read
>
> https://doc.qt.io/qbs/qml-qbslanguageitems-rule.html#rules-and-product-types
>
> Your rule is not executed because the product type is "application" and
> there is most likely no other product or rule that depends on an .out file.
>
> You should assign a file tag to the rule's output artifact and add this
> file
> tag to the product type. Something like this:
>
> CppApplication {
> type: [ "outfile"]
> // ...
> Rule {
> Artifact {
> filePath: input.fileName + ".out"
> fileTags: [ "outfile" ]
> }
> // ...
> }
> }
>
> Why do you want to copy an application executable into an .out file? That
> seems pointless. Do you maybe want to change the executable suffix? There
> is
> an undocumented property cpp.executableSuffix which you could try:
>
> CppApplication {
> cpp.executableSuffix: ".out"
> // ...
> }
>
> I don't know why it is undocumented. Maybe some linkers do not allow to
> change the suffix.
>
>
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> https://lists.qt-project.org/listinfo/qbs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20190706/d14f1416/attachment.html>
More information about the Qbs
mailing list