On Thursday, 8 February 2018 13:22:12 CET william.croc...@analog.com wrote:
> 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.
> 
> The bad approach you suggest above is exactly what
> I am looking for. :-)

The correct statement in this sentence is "bad approach". QMake is designed 
this way - suck it up or chose a different build tool!

BTW: the general direction of most of my projects is to accumulate more 
directories and more project files with all the common stuff in a central .pri 
file. Refactoring for me usually means to split up projects into independent 
libraries that can be more freely combined and more easily tested. 
Modularization isn't popular because it is a cool word, but because it works.

You are not doing yourself any service by insisting on a single directory and 
a single project file - on the contrary you are creating a trap that your 
future self with get sucked into. Good luck! You will need it.

> > 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

For complex projects to have a separate makefile to direct the build process is 
a good idea anyway. But please keep the projects in separate files and if at 
all possible in separate directories. You will thank yourself for this later.

If you don't believe me: please go ahead and try, but plan significant time for 
refactoring a few years from now. I'm sure you'll come to the same conclusions 
that I (and most of us seniors here) did years ago.


        Konrad

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to