Thank you and I understand the reluctance. In this case I believe it would be
worth it. What I did is merely a workaround because there is no other way to
dynamically create products in Qbs. By lifting that restriction (QML supports
dynamically created objects) it would open almost endless possibilities even if
you did not support anything beyond that.
Regarding my solution and its flexibility. Well it all boils down to how "granular" your projects are. If
they are uniform (in terms of file structure and location) then you woud not need anything extra. If each has its
own "specific" then there is no place for automating it. Or if you do not follow the same pattern always
(e.g. #include <> for external and "" for internals) then you would need more logic handling that
and at some point the amount of work going into automating the flaky projects would exceed the cost of writing and
maintaining the project files manually.
I reckon that official support for such things would ultimately result into some sort of
"rules" that would allow user to define and describe their project (as opposed
to typing everything out). Like a rule that would say that any directory with a file
containing main() is App (and could be promoted to QtApp automatically when the includes
would be found). Or like I do now that if there is a /tests/ dir under a project each
.h/.cpp combination constitutes a test case etc.
Then again I do not think you would have to go that far (at least for now).
Making it possible (or rather easier than writing the files programatically)
would be more than enough in my opinion.
Best wishes,
Michael
______________________________________________________________
Od: Joerg Bornemann <[email protected]>
Komu: [email protected], [email protected]
Datum: 27.06.2017 13:51
Předmět: Re: [Qbs] Qbs Automatic Projects
On 26/06/2017 10:44, [email protected] wrote:
[...]
> I tried Qbs and immediately recognised it had even bigger
> potential for automating project definitions except... it discourages
> doing that (see for example this
> <https://bugreports.qt.io/browse/QBS-1119 <https://bugreports.qt.io/browse/QBS-1119>> and quite a few other
> instances where such approach is discouraged). I honestly do not
> understand why. What does it bring me to type out the same thing over
> and over again? You would not do it in your code. You would make a
> method or class or at least a loop. Yet for some reason I am supposed to
> do that with project files...
Be assured that nobody want to discourage you from doing anything. If
you have any specific use case in mind, please comment on the bug reports.
We are reluctant though to implement heaps of special features that are
useful for only one person. That's how qmake became what it is today.
> Model scenario
[...]
That's an impressive showcase containing some interesting ideas!
If that's really flexible enough for all kinds of projects is
questionable though.
Cheers,
Joerg
_______________________________________________
Qbs mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs