It doesn't work. It still points to the original path.
export QTDIR=/tmp
mkdir /tmp/bin
echo "[Paths]" > /tmp/bin/qt.conf
echo "Prefix=/opt/" >> /tmp/bin/qt.conf
mkdir /tmp/testbed
cd /tmp/testbed
touch main.cpp
qmake -project
qmake
make
export QTDIR=/tmp
mkdir /tmp/bin
echo "[Paths]" > /tmp/bin/qt.conf
echo "Prefix=/opt/" >> /tmp/bin/qt.conf
mkdir /tmp/testbed
cd /tmp/testbed
touch main.cpp
qmake -project
qmake
make
To copy to clipboard, switch view to plain text mode
Result:
g++ -c -pipe -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/lib/qt4/include/QtCore -I/usr/lib/qt4/include/QtGui -I/usr/lib/qt4/include -I. -I. -o main.o main.cpp
g++ -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -o testbed main.o -L/usr/lib -lQtGui -L/usr/lib -pthread -lpng -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
As for me if it worked, it should have complained about missing specs but it's still seeing my installation at /usr/lib/qt4.
Even after linking qmake to /tmp/bin/qmake:
$ ./qmake -v
QMake version 2.01a
Using Qt version 4.5.2 in /usr/lib
and:
$ env|grep QTDIR
QTDIR=/tmp
Am I doing something wrong?
I think that if it was that simple, Qt installation script wouldn't be patching qmake binaries.
Bookmarks