Search code examples
qmake

Qmake: how to check for Qmake version


I want to write some Qmake project files which are both compatible with Qmake 4 and Qmake 5.

There are subtle differences where I need to check if I it uses Qmake 4. How can I do such a check?


Solution

  • You can check Qt version in pro file:

    equals(QT_MAJOR_VERSION, 4): # do something for Qmake 4
    equals(QT_MAJOR_VERSION, 5): # do something for Qmake 5