Building Qt 4.8.5 for Maya 2015 on Mac OS X 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. Unpack The Archive ------------------ Unpack the archive using the following command: tar xzf qt-adsk-4.8.5.tgz then step into the resulting directory: cd qt-adsk-4.8.5 OpenSSL ------- ensure that the OpenSSL development files are installed on the machine /usr/include/openssl/opensslv.h Xcode ----- Maya 2015 is built using Xcode 4.6.3 with the 10.8 sdk Qt 4.8.5 can be built on Mountain Lion, with Xcode 4.6.3 and the 10.8 sdk Configure --------- Configure the Qt build using the following command: ./configure -prefix /Users/myHomeDir/qt/qt-4.8.5 -arch x86_64 -debug-and-release -nomake examples -stl -plugin-sql-sqlite -no-rpath -no-qt3support -platform unsupported/macx-clang -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk The argument to the '-prefix' flag determines where Qt will be installed. In this case we're installing it into a user's local directory. The configuration process should end with the following message: Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into /Users/myHomeDir/qt/qt-4.8.5 To reconfigure, run 'make confclean' and 'configure'. Note that the path where Qt will be installed, as listed in the above message, will vary depending upon the location of the directory where you executed the './configure' command. Build ----- Build the binaries using the following command: make -j 8 >& build.log The '-j' flag instructs 'make' to use multiple processes, which can speed up the build on multicore systems. For optimal results the value after '-j' should be roughly double the number of cores on your system. Install ------- Install Qt using the following command: make install This will install Qt into the directory given for the '-prefix' flag when you configured Qt. E.g: /Users/myHomeDir/qt-4.8.5 Add the 'bin' directory (e.g. /Users/myHomeDir/qt-4.8.5/bin) to the start of your path. Due to a bug in Qt's 'qmake' command, the library and header files for the QtUiTools module are referenced using hard-coded paths in /usr/lib and /usr/include rather than using the installation directory provided to the ./configure command. To work around this problem you will need to copy the files into the directories expected by qmake. E.g: cp -r /Users/myHomeDir/qt-4.8.5/include/QtUiTools /usr/include cp -r /Users/myHomeDir/qt-4.8.5/lib/libQtUiTools* /usr/lib You will need to have superuser privilege to make the copies. The directory where you expanded the archive is no longer needed and may be deleted if you wish to free up the space. Build The devkit Qt Plug-ins ---------------------------- You can test your Qt installation by building the Qt plug-ins which ship with Maya's devkit. First, make sure that the 'qmake' command is in your path and is pointing into your installation directory: which qmake In our example installation, that should return the following: /Users/myHomeDir/qt-4.8.5/bin/qmake If not, then you must add the Qt bin directory to the start of your path. To build Maya's Qt plug-ins can be built as follows: 1) Copy Maya's devkit/plug-ins directory to some place where you have write privileges. E.g: cp -r /Applications/Autodesk/maya2014/devkit/plug-ins ~/myPlugins 2) Move into that directory: cd ~/myPlugins 3) Execute the following command: make -f Makefile.qt 4) Clean up unneeded intermediate files: make -f Makefile.qt clean If in step 3 you get the following error message: Qt not found. Qt-based plug-ins will not be built. that means that the 'qmake' command could not be found in your path.