PDA

View Full Version : using the subdirs Template



bhs-ittech
11th September 2007, 11:00
I have a project using a few modules and I use a project file that looks a bit like this:

TEMPLATE = subdirs
CONFIG = debug_and_release
SUBDIRS = main plug1 plug2 plug3 addin1 addin2 servcfg

I've used the configuration 'debug_and_release' in the hope that
I can use the command: 'make release' to build a release version
of all the modules, however it doesn't set up a way to build target
release. It only use the default build for the projects in the subdirs
which is debug.

They all have the option:

CONFIG += debug_and_release
in their project file and work well when I cd to the dir. and execute
'make release'. It's just a pain to do manualy to all the modules.

Is there a way to get the 'subdirs' template to add a "release target"
to all its subdirs?

(Qt version is 4.1.4 GPL(MingW))

wysota
11th September 2007, 11:12
Maybe not the best, but a working solution is to call "qmake -r CONFIG+=release" in the top level directory. qmake will iterate subdirectories and call itself with CONFIG+=release for each target. Then calling make should do the trick.

bhs-ittech
23rd November 2007, 10:45
first of all sorry for bumping this topic.

However I've upgraded to Qt 4.3.2
(primarily to get https support)

and I've noticed that using a project like this:

TEMPLATE = subdirs
SUBDIRS = main plug1 plug2 plug3 addin1 addin2 servcfg

qmake now create the makefile with both "release" and "debug" targets
(if the debug libs are compiled I think)

calling "qmake -r CONFIG+=release" sets "release" to default otherwise
when the debug libs has been compiled "debug" is the deafult and optained
again by calling "qmake -r"

thanks again wysota for your insigthful reply.