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 <[email protected]> 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 > [email protected] > https://lists.qt-project.org/listinfo/qbs >
_______________________________________________ Qbs mailing list [email protected] https://lists.qt-project.org/listinfo/qbs
