Question

is there a way to define the path to the qt directory in a .pro file? I've tried INCLUDEPATH += and LIB += but after qmake in the makefile always stands /usr/share/qt4 and /usr/include/qt4/ for the path to the directory where qt is installed... Maybe I could say I want to replace /usr/ with /home/ubuntu/Qt5.2.1/5.2.1/gcc or some other stuff.

Was it helpful?

Solution

What @Linville says is right. Use the correct qmake and those paths will be what you want.

Generally you should not need to set QTDIR and just running the correct qmake should work.

eg

export PATH=/home/ubuntu/Qt5.2.1/5.2.1/gcc/bin:$PATH
mkdir -p $HOME/build/myapp && cd $HOME/build/myapp
# check you have the right qmake
which qmake && qmake -query
# shadow build so as to not pollute your source tree
qmake $HOME/source/myapp/myapp.pro

If for some reason you want to refer to the paths listed by qmake -query you can use $$[QT_INSTALL_DATA] for example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top