Results 1 to 4 of 4

Thread: Order of qmake variables

  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Order of qmake variables

    hi
    Does the order of qmake variables in .pro file affect the compilation.
    if yes, please specify the correct order of the following variables

    1.TEMPLATE
    2.TARGET
    3.INCLUDEPATH
    4.DEPENDPATH
    5.include()
    6.QT
    7.HEADERS
    8.SOURCES
    9.INCLUDEPATH
    10.LIBS
    11.FORMS

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Order of qmake variables

    THe order in which you assign qmake variables does NOT alter the resulting makefiles (so it does not alter the compilation...) EXCEPT if some assignements make use of the $$ operator and reference other variables of your project files OR if you use = or ~= assignement operators. Indeed qmake interpretes your project file as a kind of script that fills a variable map and THEN generates the makefile.

    Hope this helps.

    P.S : include() is a function, not a variable. As far as I know it is equivalent, in term of control flow, to embedding the content of the included file at the exact location where your include() directive is. The $$, = and ~= considerations still apply.
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default Re: Order of qmake variables

    Thanks
    some of my project's header and source files are present in subdirectories of the projects root directory.Each subdirectory contains seperate .pro file .I want to add all these .pro files in the project's root directories .pro file.(i have only one main() funtion in the project)

    so what is the simplest way to do this.
    i do this by using the qmake variables and include() function in the following order.
    INCLUDEPATH += //to find header files
    DEPENDPATH += //same as include path to resolve dependancies (redundant)
    include()// including the .pro files

    Is there any easier way than this.

  4. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Order of qmake variables

    if your project files in subdirectories are not "real" project files (that is they do not generate an app, lib, ...) the you'd better use the .pri extension. And no, I don't know any better way of including files... The only alternative I can think of would be to fill the INCLUDEPATH and DEPENDPATH in the included files using the $$PWD variable.
    Current Qt projects : QCodeEdit, RotiDeCode

  5. The following user says thank you to fullmetalcoder for this useful post:

    babu198649 (12th January 2009)

Similar Threads

  1. Flex, Bison and qmake
    By Hydragyrum in forum Qt Programming
    Replies: 5
    Last Post: 2nd May 2011, 15:52
  2. Replies: 3
    Last Post: 6th February 2008, 12:53
  3. MacOS settings
    By skaiser in forum Installation and Deployment
    Replies: 2
    Last Post: 19th July 2007, 07:47
  4. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  5. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15

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.