Qmake: how to check for Qmake version

2019-08-05 16:17发布

问题:

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?

回答1:

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


标签: qmake