2012-06-18

According to Wikipedia qmake "is an utility that automates the generation of Makefiles [...] It integrates with the Qt framework"

You can also use it without Qt though, this is achieved by adding the following line CONFIG -= qt in the *.pro file.

In order to use qmake in a portable way one needs to:
1. Copy the qmake executable, which is statically linked, into a folder named bin
2. Create a qt.conf file near to qmake.exe containing just the following:[Paths] HostPrefix=..
3. Copy the mkspecs folder

I have copied all the above in C:\Program Files (x86)\qmake-2.01a\ and put a qmake.cmd in a bin folder which I have in path. Zipping the above folder generated an qmake-2.01a.zip which is just 996 KB in size.

qmake.cmd is nothing more than just: @"c:\Program Files (x86)\qmake-2.01a\bin\qmake.exe" %*

qmake isn't just an utility that automates the generation of Makefiles it can also generate Visual C++ project files. This is as easy as running: qmake -tp vc

How do we get rid of the MSVCR90.dll dependency? It seems this is as complicated as editing a text file, namely qmake-2.01a\mkspecs\win32-msvc2008\qmake.conf. And there change -MD and -MDd into -MT and -MTd. Now release\test.exe has increased to 41KB but there is no MSVCR90.dll dependency.

If you don't feel comfortable with editing this "system" file, you can copy it and then include the modified qmake.conf file in your pro file. Or you can use the "-spec" command line parameter to point qmake to the modified qmake.conf file.

As you can see qmake is very flexible and it can accommodate to a large number of compilers, just have a look in mkspecs folder.

If you like qmake, you will also like jom - the parallel make tool for Windows, which can be obtained from here.