Results 1 to 2 of 2

Thread: Check for Qt version in QMake

  1. #1
    Join Date
    Mar 2007
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Check for Qt version in QMake

    I have a CMake file that checks the Qt version and adds the QtIconLoader sources if the version is < 4.6 (4.6 or above the native FD.o icon loading is used).

    A user contributed a QMake file that hard-codes the qticonloader sources. It shouldn't cause a problem, the code goes totally unused if the Qt version is 4.6 or higher, but it seems just generally unclean to compile them when not needed.

    So to my question... What's the syntax to do a Qt version check in QMake? Something like

    Qt Code:
    1. <what goes here to check the version?> {
    2. SOURCES += 3rdparty/qticonloader/qticonloader.cpp
    3. HEADERS += 3rdparty/qticonloader/qticonloader.h
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Nov 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Check for Qt version in QMake

    #version check qt
    contains(QT_VERSION, ^4\\.[0-6]\\..*) {
    message("Cannot build Qt Creator with Qt version $${QT_VERSION}.")
    error("Use at least Qt 4.7.")
    }

    From qtcreator.pro

Similar Threads

  1. Replies: 7
    Last Post: 12th September 2012, 06:42
  2. Replies: 5
    Last Post: 5th June 2009, 10:07
  3. qmake and library version handling
    By viridis in forum Qt Programming
    Replies: 3
    Last Post: 6th March 2009, 09:27
  4. qmake + Incremented Builder Version Number
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2008, 15:15
  5. Qmake insert app version
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2008, 04:23

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.