I've written an article about how to build PySide2 earlier. Some partners were asking about how to build QT 5.6.1 This is a guide for building QT 5.6.1 on windows.
- Visual Studio 2012 Update 4 or Update 5
- QT 5.6.1
- Ruby 2.1.7(32 bits)
- Perl for OpenSSL
- JOM (recommended)
1. Download and unzip the tarball from the Autodesk open source distribution page
Depending on how you extracted the tar file, you may need to remove the ending digits (ie. 000644) in the extracted filename. I am using 7zip and it doesn't have this issue. Copy it into your qt folder for later usage.
2. Download the Qt distribution labeled ICU53_1
There are several files available, the one we need is icu_53_1_msvc_2012_64_devel.7z. After downloading, extract it and copy the icu53_1 folder to your QT directory (eg. C:\QT).
You can download it from OpenSSL's website. Extract it into the QT directory, you'll need to build it yourself before using it to build QT. Follow the instruction in the INSTALL.W64.
4. Update the Build Environment
Open and edit BuildQt561-VS2012.cmd and update the path. Notice that for Python, we'd recommend to use a 64 bit Python build with Visual Studio 2012 to avoid any runtime issues. But Official 64 bit Python 2.7 should also be fine to build QT.
There are several configurations in our document (howToBuildQtOnWindows_m2017.txt), I've built both debug and release version of QT. Please execute BuildQt561-VS2012.cmd in a command shell before doing following steps.
cd c:\qt mkdir qt-build-561 cd qt-build-561 ..\qt-adsk-5.6.1\configure -prefix C:\qt\qt-adsk-5.6.1.out -debug-and-release -force-debug-info -opensource -icu -opengl desktop -directwrite -openssl -plugin-sql-sqlite -I c:\qt\openssl\1.0.1l-vc11-nossl3\include -L c:\qt\openssl\1.0.1l-vc11-nossl3 -no-warnings-are-errors -nomake examples -nomake tests
I copied my OpenSSL build into c:\qt\openssl\1.0.1l-vc11-nossl3. The OpenSSL include folder path should point to inc32 folder inside your OpenSSL source package. I made some changes to the path according to the document, you don't have to do it yourself.
The prefix for parameter is for the final step. You need to specify a directory for the final output package.
For more details about the parameters, please refer to the “how-to” inside the QT package.
If you want to use all of your cores to build it, it is better to get JOM from QT and put its path in the PATH environment variable. Otherwise you can run nmake directly.
jom > build.log or nmake
7. Make install
Just run nmake install, it will create a final output in the prefix directory in Step 5.
Now that you have built QT 5.6.1 for Maya, you could try to build examples in your QT\Examples folder with your customized QT. When finished, you can put the built programs into the Autodesk QT folder\bin and it should be working properly. Enjoy:)