質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top