PDA

View Full Version : qmake and *.pro file



Teuniz
20th October 2009, 11:58
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?

spirit
20th October 2009, 12:05
have a look at contains in docs about QMake.

Teuniz
20th October 2009, 12:40
Thanks. I use the following "code" in a *.pro file to check if Qt version >= 4.5.3:


!contains(QT_MAJOR_VERSION, 4) {
error("you are using an old version of Qt")
}

LIST = 0 1 2 3 4
for(a, LIST):contains(QT_MINOR_VERSION, $$a):error("you are using an old version of Qt")

contains(QT_MINOR_VERSION, 5) {
LIST = 0 1 2
for(a, LIST):contains(QT_PATCH_VERSION, $$a):error("you are using an old version of Qt")
}