Qt QML Compile Sources for OpenGL Visual Studio 2015

To build the Qt sources by your own you have to do the following steps:

  1. Download and install Visual Studio 2015. I took the Community edition.
  2. Download and install Qt. I took the Visual Studio 2015 Desktop version.
  3. Download and install Python. It has to be installed to compile QML.
  4. Open the Visual Studio ‘Developer Command Prompt for VS2015’: Windows Start – Visual Studio¬†2015 – Developer Command Prompt for VS2015
  5. Than run the following command chain
    >> cd "Path/to/the/Qt/source/folder/" (in my case C:\Qt\5.7\Src)
    
    Follow this link to get more information about the configuration parameters. In my case I recompile the source code to use OpenGL.
    
    >> configure -opengl -desktop -platform win32-msvc2015
    
    The supported platform parameter could be found in this directory: 'C:\Qt\5.7\msvc2015_64\mkspecs'. The parameter title is the directory name.
    
    >> nmake
    
    Now lay back and drink a coffee. It will at least last a hour...
  6. For using OpenGL insert the following to your pro file
    QT += qml quick opengl
    LIBS += 'C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/OpenGL32.Lib' (in my case, just search for the OpenGL32.Lib)
  7. Congratulations! Now you can start with QML and OpenGL!