Qt – overriding qt4 compile time settings

qt4

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?

Best Answer

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.