I'm searching for a way to force a specific version of QT in a .pro file. To be more specific, I'd like to force qmake
to use only QT 5.x version with my project instead of QT 4.x and QT 5.x
Is there a way to do so?
PS: I'm not asking for a way to stop/halt the compile process (aka check QT version, and if lower than 5.x just throw qFatal/equivalent). I'm looking for a way to actually choose which version to use while generating the Makefile
with qmake
You can throw a error if a user is running qmake with a version you do not want him to use. ex:
lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5")
I really doubt you can do this. qmake
is a part of framework and goes together with libraries. When you say Qt of specific verion
you mean only libraries, but it is not correct.
To use specific version of Qt, you actially need to run different version of qmake
. If you are using QtCreator - you should select it in project's options, if not - type absolute path to file qmake
. You can find out, which version of Qt qmake
uses, you can type qmake --version
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With