Building Qt 4.8.5 for Maya 2015 on Windows Overview -------- Maya uses a customized version of Nokia's Qt libraries. If you want to write Maya plug-ins which also make use of Qt you will have to build Qt from the modified source files provided in this directory and link your plug-ins against those libraries. qt-adsk-4.8.5.tgz contains the modified Qt source code, in tarred, gzipped form. adsk-qt485-patch.txt contains the customizations to the standard Qt source, in standard patch diff format. You do not need to apply the patch file as the .tgz file already contains the changes. The patch file is just provided for informational purposes. Note that 32-bit and 64-bit versions of Qt cannot coexist in the same directory tree. If you want both versions installed on the same system then you will have to configure, build and install Qt twice, using different installation directories each time. Unpack The Archive ------------------ Some common file compression utilities on Windows, like WinZip, have been known to corrupt some of the filenames in the Qt source archive by appending '0000644' to the ends of their names. Cygwin's 'tar' command can unpack the archive without error, so if you have Cygwin installed on your system use that: tar xzf qt-adsk-4.8.5.tgz If you don't have Cygwin then use your favourite archive extraction tool to unpack the archive, but then check to make sure that none of the filenames have been corrupted. For the purposes of these instructions we will assume that the archive has been unpacked into c:\qt-adsk-4.8.5, so to check for bad filenames you would do the following: cd \qt-adsk-4.8.5 dir /s *644 If the commands above find any files ending in '000644' you must remove those digits before continuing with the build. Also, make sure that there is a file called 'configure.exe' in the top directory (e.g. c:\qt-adsk-4.8.5). Some virus checkers don't like executables named 'configure' so if the file is not present try disabling your virus checking software and unpack the archive again. Start Up A Visual Studio 2012 Command Prompt -------------------------------------------- If Visual Studio 2012 is installed normally then you can find the Visual Studio Command Prompt in the Windows Start menu, in All Programs -> Microsoft Visual Studio 2012 -> Visual Studio Tools. If you are building for 32-bit Maya, select 'Visual Studio 2012 Command Prompt'. If you're building for 64-bit Maya, select 'Visual Studio 2012 x64 Win64 Command Prompt'. In the command prompt window, move into the directory into which the archive was unpacked: cd \qt-adsk-4.8.5 OpenSSL ------- On Windows, Qt needs a bit of help to have OpenSSL support for QtNetwork We dynamically link in the OpenSSL 1.0.1c build of OpenSSL. the include and pre-built modules are provided in a parallel directory to the Qt source code i.e. d:\qt\4.8.5-64 d:\qt\openssl-1.0.1c d:\qt\openssl-1.0.1c\include d:\qt\openssl-1.0.1c\x64 When configuring Qt will add in the command line options required to include these libraries configure.exe [your normal options] -openssl -I -L Configure --------- From a Visual Studio 2012 sp1 x64 Win64 Command Prompt window. configure will then automatically define the platform to be win32-msvc2012 the following command lines assume the build is with a directory structure layout as: d:\qt\4.8.5-64 d:\qt\openssl\1.0.1c\ If both debug and release versions of the libraries are wanted, execute the following command: 64 bit build: configure -debug-and-release -stl -no-qt3support -openssl -plugin-sql-sqlite -I \qt\openssl\1.0.1c\include -L \qt\openssl\1.0.1c\x64 If you only want release versions of the libraries, execute the following command: configure -release -stl -no-qt3support -openssl -plugin-sql-sqlite -I \qt\openssl\1.0.1c\include -L \qt\openssl\1.0.1c\x64 If you only want debug versions of the libraries, execute the following command: configure -debug -stl -no-qt3support -openssl -plugin-sql-sqlite -I \qt\openssl\1.0.1c\include -L \qt\openssl\1.0.1c\x64 If the command fails to run it may be due, once again, to overzealous virus checking software. Try renaming configure.exe to cfg.exe then re-run the command using that. E.g: cfg -debug-and-release -stl -no-qt3support -openssl -plugin-sql-sqlite -I \qt\openssl\1.0.1c\include -L \qt\openssl\1.0.1c\x64 When the configuration is complete it should display the following message: Qt is now configured for building. Just run nmake. To reconfigure, run nmake confclean and configure. Build ----- Rather than using nmake to build Qt, we'll use the 'jom' tool from the Nokia SDK Tools, since that makes better use of multiple cores. To start the build, execute the following command: c:\qt\2010.05\bin\jom Build The devkit Qt Plug-ins ---------------------------- You can test your Qt installation by building the Qt plug-ins which ship with Maya's devkit. Start up a Windows Command Prompt window and set the following environment variables in it: set QTDIR=c:\qt-adsk-4.8.5 set PATH=%QTDIR%;%SystemRoot%\System32 set QMAKESPEC=win32-msvc2012 If you're on a 64-bit system and are building plugins for 64-bit Maya, execute the following command: call "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall" amd64 If you have write access to Maya's directory tree then you can move into Maya's devkit/plug-ins directory and build the plug-ins right there: Ensure that the copy of qmake that is used, is correct. qmake.exe will check for a file by the name of qt.conf in the same directory as qmake.exe this qt.conf file will override any of the path settings defined within it. include, lib and bin are the common ones. the qt.conf file that ships with Maya is setup for relative paths to where Maya is installed. By default Maya ships the Qt include and mkspec directories compressed. to be used for making plugins, one needs to expand them first. they can be expanded in place cd \Program Files\Autodesk\Maya2015\devkit\plug-ins nmake -f Makefile.qt If you don't have write access to Maya's directory tree then you will need to copy Maya's devkit/plug-ins directory somewhere where you do have write access. E.g: xcopy /s /i "c:\Program Files\Autodesk\Maya2015\devkit\plug-ins" c:\myPlugins Move into the copy directory: cd \myPlugins Edit the 'qtconfig' file and change the relative paths to Maya's 'lib' and 'include' directories to absolute paths. So this line: LIBS += -L..\..\lib -lOpenMaya -lFoundation would be changed to this: LIBS += -L"c:/Program Files/Autodesk/Maya2015/lib" -lOpenMaya -lFoundation and this line: INCLUDEPATH += . ../../include would be changed to this: INCLUDEPATH += . "c:/Program Files/Autodesk/Maya2015/include" You can then use the 'nmake' command to build the plugins: nmake -f Makefile.qt The .mll files for the plug-ins will end up in the 'release' sub-directory. If you want to clean up the intermediate files from the build, move the .mll and .pdb files out of 'release' and into some place safe, then execute the following command: nmake -f Makefile.qt clean