[Qbs] A simple project that copy an executable does not work

Richard Weickelt richard at weickelt.de
Sun Jul 7 18:33:07 CEST 2019


> No, this is not possible. The reason is that in common case those products
> (applications, libraries) will diverge in some way. For example, you might
> want to use different resources - icons (you probably do not want to name
> them icon1.png and icon2.png, right?), .desktop entires on Linux, plist
> files on Mac…
> 
> However, you might want to share some properties among those applications -
> that can be achieved via inheritance - you inherit the CppApplication item
> in a file, say, MyApplication.qbs, specify common properties (cpp.cxxFlags,
> cpp.cxxLanguageVersion, etc…) and then instantiate MyApplication and only
> specify only what’s different (files: «main1.cpp» and files: «main2.cpp» in
> your case). That way you don’t need to write all that boilerplate code over
> and over again.

Some links to illustrate what Ivan just explained:

https://doc.qt.io/qbs/custom-modules.html#making-qbs-aware-of-custom-modules-and-items

A customized Product item:
https://code.qt.io/cgit/qbs/qbs.git/tree/src/app/qbs/qbs.qbs

The related base item:
https://code.qt.io/cgit/qbs/qbs.git/tree/qbs-resources/imports/QbsApp.qbs



More information about the Qbs mailing list