tags:

views:

344

answers:

3

Hello, I'm trying to compile a qt app with qt4 sdk + tools we've checked into our source control server(p4). Specifically, I've converted the qt4 project (.pro) file into a visual studio project file which is syntatically correct and accepted by VS.

The problem is the location of the resource and MOC compilers. Qmake is configuring the visual studio project file to point to the location on the machine where qt4 was originally built.

When I check out the source, libraries and binaries, they are in a different location. There's a great deal of environemnt variables which affect qt4 + qmake behaviour but I cannot find one which will allow me to override the location of the resource and moc compilers. Can anyone help?

+1  A: 

got it!, qmake -query "QT_INSTALL_PREFIX" will tell you where qt believes it's been installed. This can be changed with : "qmake -set VARIABLE VALUE"

Got this information from : http://doc.trolltech.com/4.5/qmake-environment-reference.html

Should have checked there first really :-)

this is not entirely correct, the qmake "set" and "query" commands do allow for the setting of persistant data but do not allow the qt installation variables to be overridden, argh!, so setting QT_INSTALL_PREFIX to an arbitrary value will not work :-(
+1  A: 

Take a look at QMAKESPEC information, and have a look inside some of the make specs available. In this case, for the common/linux.conf make spec, it includes the following lines:

QMAKE_MOC             = $$[QT_INSTALL_BINS]/moc
QMAKE_UIC             = $$[QT_INSTALL_BINS]/uic

From these, I would assume you could change the definition of the QT_INSTALL_BINS variable to point to your new location. Alternately, you could just override the QMAKE_MOC or QMAKE_UIC variables to point to the executables you desire.

Caleb Huitt - cjhuitt
A: 

Correct, the equivilant location on a windows machine is on the registry : [HKEY_CURRENT_USER]\Software\Trolltech\Versions\4.5\InstallDir

Gearoid Murphy
Traditionally, this sort of information would be configured by setting the QTDIR environment variable but this behaviour was changed in Qt4
Gearoid Murphy