PDA

View Full Version : Pick correct include file between Qt4 and Qt5



rajil.s
24th February 2017, 19:16
Hello,

I want to load the correct qwt.prf file based on the Qt version. The following code in the .pro file loads both the Qt4 and Qt5 files.



lessThan(QT_MAJOR_VERSION, 5) {
message("qt4")
include (/usr/share/qt4/mkspecs/features/qwt.prf)
}


greaterThan(QT_MAJOR_VERSION, 4) {
message("qt5")
include (/usr/lib64/qt5/mkspecs/features/qwt.prf)
}


Is there any way to make this work?

anda_skoa
25th February 2017, 10:09
If two sections are exclusive with each other, you can do "else"



lessThan(QT_MAJOR_VERSION, 5) {
} else {
}


Cheers,
_