How to use various compilers
set env variables CC and CXX before starting cmake. Exemple with icc on gentoo using tcsh, starting from the project main dir:
setenv CC /opt/intel/Compiler/11.1/056/bin/intel64/icc setenv CXX /opt/intel/Compiler/11.1/056/bin/intel64/icpc mkdir build && cd build cmake .. make
Check which 'mkspec' you need by looking in $(QTDIR)/mkspecs/, and then use
qmake -recursive -spec <specname>
The -recursive flag is great if your project was already configured with some other (default) spec file. Without it, only the main directory can be re-configured. Exemples on windows if you want to use the msvc2008 compiler.
qmake -recursive -spec win32-msvc2008 nmake
Configuring for mingw32
qmake -recursive -spec win32-g++ mingw32-make
If you want to use clang with qt, see the last section 'download'.
This is the default one on all linux distributions and most *BSD ones. Under windows, this is the compiler used by mingw32.
Command line tools are available freely from MS site.
ICC can be downloaded and used under linux for non commercial usage. Beware that there is evidence that icc purposely generate bad code when it detects a non-intel cpu. But if you just want to check against icc C++ parser, you don't mind.
For c++, I highly suggest using the svn trunk. For C and objective-C, the latest official release is ok. i use CXX=~/svn/llvm/Release/bin/clang++ If you want to use clang with qt, see the next section 'download'.
I created this quick&dirty linux-clang mkspec for linux. You'll have to change the file clang.conf to use your actual path. This is basically a copy of linux-g++ on which i've changed compilers' path. It "works for me" (c), using qt-4.6. Just extract it in your $(QTDIR)/mkspecs