I can’t find any information on how to install Qt built on Windows.
In wiki article How to set up shadow builds on Mac and Linux there’s description of -prefix option in configure script but this option is not available on Windows.
I know I can use Qt right from the build folder but it does not seem the right thing not to perform an install step. One problem with this approach is size; Qt’s build folder takes about 4GB space whereas after installing using binary installer Qt takes about 1GB space. I guess the difference is due to temporary files created during building. I hope some install procedure would install (copy) only needed files leaving temporary files in the build folder.
I can’t find any information on how to install Qt built on Windows. In
Share
As İsmail said there’s no install step for Qt on Windows.
However one can try to approximate it by performing the following operations.
Run
make cleanin the build folder to remove all temporary files.Copy build folder to the place where you want Qt “installed”. Let’s call it
INSTALL_DIR.qmake.exeexecutableRun
qmake -queryto see what paths are compiled (hardcoded) into qmake anda. Fix paths containing the build folder by replacing it with the
INSTALL_DIRusingqmake -set(1).or
b. Create a
qt.conffile in the bin subfolder of theINSTALL_DIRspecifing new Qt paths inside it.In Qt’s provided binary distributions, the pwd is included in the
QMAKE_INCDIRand thus ends up in your projects include path as “.”. This does not happen by default in a custom built Qt, so you have to add the following line tomkspecs/YOUR-PLATFORM-HERE/qmake.conffile:QMAKE_INCDIR += "."prlfilesWhen you add a Qt component to a project file (such as
CONFIG += uitools), Qt looks in%QTDIR%/lib/QtUiTools.prlto find the library dependencies of that component. These files will have the hard coded path of the directory in which Qt was configured and built. You have to replace that build directory with the one to which you moved Qt for alllib/*.prlfiles.If you made a shadow build (build made inside folder other than the one containg sources), headers in the
includesubfolder only forward to the original headers. For example;BUILD_DIR\include\QtCore\qabstractanimation.hlooks like this#include "SRC_DIR/src/corelib/animation/qabstractanimation.h"If you don’t want to depend on the existence of the folder containg sources you have to copy
SRC_DIR/srcsubfolder to your destination folder and fix all headers in theincludefolder so that they forward to the new location ofsrcsubfolder.The bottom line:
The build process of Qt under Windows makes it really akward to move (install) Qt after building. You should do this only if … well I can’t find any good reason to go through all this trouble.
Remember
The easy way is to place Qt’s sources in the folder where you want Qt to stay after building and make a build in this folder. This makes all steps but 1 and 4 above unnecessary.
1)
The variables you set with
qmake -setare saved in the registry keyHKEY_CURRENT_USER\Software\Trolltech\QMake\<QMAKE_VERSION>.Because of this you might have a problem when you would like to have different projects using different versions of Qt which happen to have the same version of qmake. In this case the better solution is to use
qt.conffile (actually files as you need one file for each Qt installation) (option 3b).Many of the information above come from the RelocationTricks wiki page authored by Gabe Rudy. Check out his Qt (Qt4) Opensource Windows Installers of Pre-built Binaries with MSVC 2008 project which gives you easy solution of above problems.