Results 1 to 3 of 3

Thread: qmake and *.pro file

  1. #1
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    64
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qmake and *.pro file

    I would like to make a conditional statement in a *.pro file which checks the current version of Qt using the qmake variable QT_MINOR_VERSION.

    Something like:

    if(QT_MINOR_VERSION<5)
    {
    error("you are using an old version of Qt\n");
    }

    How do I do this with qmake syntax?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qmake and *.pro file

    have a look at contains in docs about QMake.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    Teuniz (20th October 2009)

  4. #3
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    64
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake and *.pro file

    Thanks. I use the following "code" in a *.pro file to check if Qt version >= 4.5.3:

    Qt Code:
    1. !contains(QT_MAJOR_VERSION, 4) {
    2. error("you are using an old version of Qt")
    3. }
    4.  
    5. LIST = 0 1 2 3 4
    6. for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("you are using an old version of Qt")
    7.  
    8. contains(QT_MINOR_VERSION, 5) {
    9. LIST = 0 1 2
    10. for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("you are using an old version of Qt")
    11. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Teuniz; 20th October 2009 at 13:45.

Similar Threads

  1. qmake file info
    By Lodorot in forum Qt Programming
    Replies: 1
    Last Post: 4th September 2009, 22:23
  2. qmake using source files not in .pro file
    By Asperamanca in forum Newbie
    Replies: 12
    Last Post: 9th July 2009, 15:29
  3. Replies: 2
    Last Post: 28th June 2009, 12:39
  4. qmake can't process project file on windows
    By s-troz in forum Qt Programming
    Replies: 3
    Last Post: 25th October 2008, 14:51
  5. making qmake create VisualStudio console app project file?
    By akos.maroy in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2008, 14:45

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.