[Interest] Two from one.

Benjamin TERRIER b.terrier at gmail.com
Thu Feb 8 23:02:46 CET 2018


2018-02-08 19:22 GMT+01:00 william.crocker at analog.com <
william.crocker at analog.com>:

>
> If I create a separate .pro file for lib and main,
> I would then have to create yet a third file
> to hold the common lines for inclusion in those first
> two. That is not moving in the right direction.
>

May I suggest that having 3 files might be moving in the right direction.
Do you think the fewer the better?

Think about C++ classes and files. If you have 3 classes like A, B and C,
it is common practice
to have them defined in 3 header files in particular if they are complex
classes, even if both B and C inherits from A.
And hardly anyone would try to put the 3 of them in a single header file,
even though C++ completely support having an
arbitrary number of classes in a single file.


>
> The bad approach you suggest above is exactly what
> I am looking for. :-)
>
> And then you could build it like so:
>>      qmake CONFIG+=build_lib
>>      make
>>      qmake
>>      make
>>
>
> No problem. Those commands would go in
> my (non .pro created) makefile.
> All I ever have to do is type: make
>
>
Even if it fits your needs, by using qmake in a non standard way you are
likely to run into troubles when
you will want to use qmake related tools like Qt Creator. Also you are
likely to increase the time a developer will need to
comprehend your project and its build mechanism. I do not think any Qt
developer is expecting a single .pro to build both
a shared library and an executable.

If you do all this just to accommodate your taste in file count, please
consider changing your taste and using qmake in a standard way.

Regards,

Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180208/00ce9c8b/attachment.html>


More information about the Interest mailing list