Results 1 to 3 of 3

Thread: using the subdirs Template

  1. #1
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question using the subdirs Template

    I have a project using a few modules and I use a project file that looks a bit like this:
    Qt Code:
    1. TEMPLATE = subdirs
    2. CONFIG = debug_and_release
    3. SUBDIRS = main plug1 plug2 plug3 addin1 addin2 servcfg
    To copy to clipboard, switch view to plain text mode 

    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:
    Qt Code:
    1. CONFIG += debug_and_release
    To copy to clipboard, switch view to plain text mode 
    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))

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: using the subdirs Template

    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.

  3. The following user says thank you to wysota for this useful post:

    bhs-ittech (11th September 2007)

  4. #3
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using the subdirs Template

    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:
    Qt Code:
    1. TEMPLATE = subdirs
    2. SUBDIRS = main plug1 plug2 plug3 addin1 addin2 servcfg
    To copy to clipboard, switch view to plain text mode 

    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.

Similar Threads

  1. qmake failure for SUBDIRS template on OSX
    By lonejedi in forum Newbie
    Replies: 3
    Last Post: 24th May 2010, 00:02
  2. qt 4.2.2 install in tru64 cxx
    By try to remember in forum Installation and Deployment
    Replies: 0
    Last Post: 30th March 2007, 07:43
  3. RFC: A Complex(er) QMake Template
    By camel in forum Qt-based Software
    Replies: 1
    Last Post: 19th January 2007, 10:10
  4. how to write a template function in a form..
    By nass in forum General Programming
    Replies: 7
    Last Post: 18th December 2006, 19:36
  5. problem using template
    By mickey in forum General Programming
    Replies: 6
    Last Post: 18th November 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.