[Qt-interest] QMAKE to execute SUBDIRS first

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Thu Aug 19 11:18:32 CEST 2010


On Thu, Aug 19, 2010 at 2:31 PM, Chitrang Srivastava
<chitrang.srivastava at gmail.com> wrote:
> OK I am not using TEMPLATE=SUBDIR., TEMPLATE is set to APP
> I am using SUBDIRS in this prof file because the targets needs something
> which lies in one of the SUBDIRS

Then keep the app in it's own directory and add that dir to the
top-level PRO file (which has template=subdirs).

While using SUBDIRS template, you can use the 'ordered' config (CONFIG
+= ordered) and place the dir containing the dir which you want built
first before your app dir. This will ensure that your app project is
built _after_ the other dependency is built.

Though this is not a very robust method as someone later might
accidentally change that order and break your build.

Better approach is to add dependency to your app's build.

TEMPLATE = subdirs
SUBDIRS = mylib app

mylib.subdir = lib_dir

app.subdir = app_dir
app.depends = sub_lib

I had read this as part of a 'undocumented' qmake doc (don't have the
link handy)! :)

Haven't tired it myself, but looks like it should work...

HTH,
-mandeep


> and I want that SUBDIRS to get build first , before compiling the APP
> targets.
>
> On Thu, Aug 19, 2010 at 2:13 PM, Andreas Pakulat <apaku at gmx.de> wrote:
>>
>> On 19.08.10 13:15:23, Chitrang Srivastava wrote:
>> > I have a situation where I want SUBDIRS to build first (make) and then
>> > the
>> > objects of current make file to start building.
>> > What option to I have to add in my pro file.?
>>
>> I'm confused, how do you have something to compile from a .pro file that
>> uses SUBDIRS? Qmake (at least time I tried) doesn't allow to mix different
>> template types (i.e. SUBDIRS and APP or LIBRARY in the same .pro file).
>>
>> Andreas
>>
>> --
>> You possess a mind not merely twisted, but actually sprained.
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>



More information about the Qt-interest-old mailing list