Hi Richard and Ivan, I tried a project called qbs-autoproject <https://github.com/Resurr3ction/qbs-autoproject.git>that can generate qbs files automatically. I modified the example to try whether multiple executables can be generated without adding CppApplication by myself, the result was that multiple executables were generated successfully without adding CppApplication by myself on Ubuntu 18.04. After qbs-autoproject had been parsed in Qt Creator, qbs-autoproject/.autoproject/example.autoproject.qbs was generated. Two executables "app1d" and "app2d" were generated when the project was built.
You can try the example I modified, the project is attached. The next thing I want to do is investigating whether qbs-autoproject can be used in complicated projects. Thanks, Vincent On Mon, 8 Jul 2019 at 00:33, Richard Weickelt <rich...@weickelt.de> wrote: > > 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 > > _______________________________________________ > Qbs mailing list > Qbs@qt-project.org > https://lists.qt-project.org/listinfo/qbs >
<<attachment: qbs-autoproject.zip>>
_______________________________________________ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs