Adapted from the directions here and other places: http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/ Directions assume Qt 5.0 and Visual Studio 2010. Modify as necessary. TODO: -Extra flags for faster build time to be tested: -no-webkit -no-script -no-scripttools -no-qt3support -nomake demos -nomake tools -What are the path variables for?: //-Update the "PATH" environment variable to include "%QTDIR%\bin" //-Make environment variable "QMAKESPEC" with value "win32-msvc2010". //-Make environment variable "QTDIR" with value "C:\dev\Qt5.0\x86". //-Make environment variable "QTDIR" with value "C:\dev\Qt5.0\x64". REQUIREMENTS: -You need Perl for Qt >= 4.8.0 -You need the DirectX SDK (http://www.microsoft.com/en-us/download/details.aspx?id=6812). If installation fails with error s1023, ignore it. -May need to change "Start->All Programs->Microsoft Visual Studio 2010->Visual Studio Tools" command prompts. There should be two. If there's only one, then copy it and change the platform (the argument to the shortcut) to "x86_amd64". SETUP: -Download and extract source of Qt to "C:\dev\Qt5.0" (we'll move to better directories later, but the build tools don't like spaces in the path (e.g., like "Program Files" has)). -Change line 45 in "C:\dev\Qt5.0\qtbase\configure.bat" from "if not exist %QTSRC%\.gitignore goto sconf" to "::if not exist %QTSRC%\.gitignore goto sconf" (i.e., comment it out) -For static building (i.e. no DLL nonsense, otherwise completely optional): -Open "C:\dev\Qt5.0\qtbase\mkspecs\win32-msvc2010\qmake.conf" (change the 2010 as necessary) (Do this for other than qtbase too?) -Change line 9 from "CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe" to "CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target" -Change line 23 from "QMAKE_CFLAGS_RELEASE = -O2 -MD" to "QMAKE_CFLAGS_RELEASE = -O2 -MT" -Change line 24 from "QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi" to "QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi" -Change line 25 from "QMAKE_CFLAGS_DEBUG = -Zi -MDd" to "QMAKE_CFLAGS_DEBUG = -Zi -MTd" -Move the contents of the folder into two new subdirectories: -C:\dev\Qt5.0\x86 -C:\dev\Qt5.0\x64 -Add the Jom folder inside "C:\dev\Qt5.0". Jom comes from: http://qt-project.org/wiki/jom BUILD: -For x86: -Start the x86 MSVC command prompt -In it, run the following commands ("" is the number of cores [threads?] to use): -"cd C:\dev\Qt5.0\x86" -For static building: -"configure -debug-and-release -opensource -confirm-license -platform win32-msvc2010 -nomake tests -nomake examples -static" -Else: -"configure -debug-and-release -opensource -confirm-license -platform win32-msvc2010 -nomake tests -nomake examples" -"..\jom\jom.exe -j " -For x64: -Start the x64 MSVC command prompt -In it, run the following commands ("" is the number of cores [threads?] to use) (yes I know the platform looks wrong): -"cd C:\dev\Qt5.0\x64" -For static building: -"configure -debug-and-release -opensource -confirm-license -platform win32-msvc2010 -nomake tests -nomake examples -static" -Else: -"configure -debug-and-release -opensource -confirm-license -platform win32-msvc2010 -nomake tests -nomake examples" -"..\jom\jom.exe -j " -Build for each takes about 15-20 minutes on a Intel 990X (hex core extreme) with 16 threads (for N). FINAL: -Move the entire "C:\dev\Qt5.0" folder inside "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A"