howToBuildQtOnMac m2016

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

Building Qt 4.8.

6 for Maya 2016 on Mac OS X


Overview
-------Maya uses a customized version of Digia'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.6.tgz contains the modified Qt source code, in tarred, gzipped form.
adsk-qt486-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.6.tgz
then step into the resulting directory:
cd qt-adsk-4.8.6

OpenSSL
------ensure that the OpenSSL development files are installed on the machine
/usr/include/openssl/opensslv.h

Xcode
----Maya 2016 is built using Xcode 5.0.2 with the 10.8 sdk
Qt 4.8.6 can be built on Mountain Lion, with Xcode 5.0.2 and the 10.8 sdk

Configure
--------Configure the Qt build using the following command:
./configure -prefix /Users/myHomeDir/qt/qt-4.8.6 -arch x86_64 -debug-and-release
-nomake examples -stl -plugin-sql-sqlite -no-rpath -no-qt3support -platform uns
upported/macx-clang-libc++ -sdk /Applications/Xcode.app/Contents/Developer/Platf
orms/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.6
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.6
Add the 'bin' directory (e.g. /Users/myHomeDir/qt-4.8.6/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.6/include/QtUiTools /usr/include
cp -r /Users/myHomeDir/qt-4.8.6/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.6/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/maya2016/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.

You might also like