Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing specific version of QT in .pro file

Tags:

qt

qmake

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

like image 458
alexandernst Avatar asked Dec 15 '22 11:12

alexandernst


2 Answers

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")
like image 160
Ashish Avatar answered Jan 10 '23 10:01

Ashish


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.

like image 36
Amartel Avatar answered Jan 10 '23 09:01

Amartel