PDA

View Full Version : library not build automatically



KoosKoets
26th March 2007, 13:03
Hi folks,

I'm new to Qt, qmake and this group, so please forgive my ignorace. I've searched the forums for my problem but to no avail...

I have a small build problem with qmake which I don't know how to solve...

My code is organized as:

sw/gen/inc
sw/gen/src
sw/gen/gen.pro --> builds a static library of all sources in gen/src and puts it in sw/gen/lib as libgen.a

sw/app/src
sw/app/app.pro --> builds the sources of app/src and indicates (-L../gen/lib -lgen) that it shall link libgen.a.

However, if I change a source file in gen/src and then build the application, the library is not automaticlly rebuild. Or: if I rebuild the library myself and then rebuild the application, make tells me that there is nothing to do... This is annoying.

What must I do to my .pro files to set these dependencies?

Kind regards,

Koos

jacek
26th March 2007, 13:43
You need another .pro file in sw directory:
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += gen app
If you use it to build your project, it will try to build the library first and then the application.