Results 1 to 3 of 3

Thread: Differences between SUBDIRS+=*.pro and include(*.pro) statement

  1. #1
    Join Date
    Jan 2009
    Posts
    53
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Differences between SUBDIRS+=*.pro and include(*.pro) statement

    Hi,

    What is the differences between SUBDIRS+=*.pro and include(*.pro) statement in qmake? I'm trying to pass a DEFINES value into the SUBDIRS statement.

    WholeSolution.pro
    Qt Code:
    1. TEMPLATE = subdirs
    2. CONFIG = ordered
    3. DEFINES *= UNIT_TESTS
    4.  
    5. SUBDIRS += App/Solution.pro
    6. # include(App/Solution.pro)
    To copy to clipboard, switch view to plain text mode 

    App/Solution.pro
    Qt Code:
    1. contains(DEFINES, UNIT_TESTS) {
    2. SUBDIRS += UnitTest/UnitTest.pro
    3. }
    To copy to clipboard, switch view to plain text mode 

    App/Solution.pro does not inherit the UNIT_TESTS definition.

    Please advice. Thanks in advance.

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

    Default Re: Differences between SUBDIRS+=*.pro and include(*.pro) statement

    SUBDIRS creates separate projects for each entry each with a target of its own. Include will create a single project with a single target.

    The best method to obtain what you want in a clear way is to create a .pri file containing all the statements that are to be shared by each of the projects and include that file from each project.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    sheeeng (11th March 2010)

  4. #3
    Join Date
    Jan 2009
    Posts
    53
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Differences between SUBDIRS+=*.pro and include(*.pro) statement

    Thanks, wysota. Nice tip.

Similar Threads

  1. lupdate doesn't see any sources in subdirs
    By araglin in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2009, 07:30
  2. confusion with a STATEMENT used frequently
    By salmanmanekia in forum Newbie
    Replies: 3
    Last Post: 11th June 2008, 20:54
  3. using the subdirs Template
    By bhs-ittech in forum Newbie
    Replies: 2
    Last Post: 23rd November 2007, 10:45
  4. SmartFOSS Mission Statement
    By travlr in forum Qt-based Software
    Replies: 0
    Last Post: 16th April 2007, 05:41
  5. Templates vcapp and subdirs together
    By xgoan in forum Newbie
    Replies: 1
    Last Post: 24th August 2006, 10:46

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
  •  
Qt is a trademark of The Qt Company.