Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes

Rebuild Qt Libraries

You can re-build the Unigine Qt libraries but it's not recommended for the Qt components to work properly.

In the Unigine SDK Qt version 5.4.1 is used.

Build Qt for Windows

Preparation

  • Build ICU libraries:
    1. Install cygwin
    2. Download ICU source code
    3. Build ICU with the following batch script, changing %CYGWIN_PATH% variable with the path where cygwin installed
      Shell commands
      set PATH=%CYGWIN_PATH%\bin;%PATH%
      call %VS120COMNTOOLS%vsvars32.bat
      :: for x64 build use:
      :: call %VS120COMNTOOLS%..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat
      cd icu/source
      bash runConfigureICU Cygwin/MSVC --enable-static --disable-shared
      nmake
      nmake install

  • Build OpenSSL libraries:
    1. Install perl
    2. Download OpenSSL v1.0.2 source code
    3. Build OpenSSL for x86, changing %PERL_PATH% variable with the path where perl installed
      Shell commands
      call %VS120COMNTOOLS%vsvars32.bat
      set PATH=%PERL_PATH%\bin;%PATH%
      cd openssl-1.0.2
      call perl Configure VC-WIN32 no-shared no-asm
      call ms\do_ms
      nmake -f ms\nt.mak
      nmake -f ms\nt.mak install
    4. For building OpenSSL 64-bit version use the following script
      Shell commands
      call %VS120COMNTOOLS%..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat
      set PATH=%PERL_PATH%\bin;%PATH%
      cd openssl-1.0.2
      call perl Configure VC-WIN64A no-shared no-asm
      call ms\do_win64a
      nmake -f ms\nt.mak
      nmake -f ms\nt.mak install

Build

Download sources of Qt modules and unpack them

qtbase-opensource-src-5.4.1.zip

qttools-opensource-src-5.4.1.zip

qtwebkit-opensource-src-5.4.1.zip

  • Build Qt base libraries with the script, setting variables %ICU_PATH% and %OPENSSL_PATH% before
    Shell commands
    set QMAKESPEC=win32-msvc2013
    call %VS120COMNTOOLS%vsvars32.bat
    set PREFIX=%~dp0
    set LIBDIR=%~dp0\lib
    set INFIX=Unigine_x86
    set PATH=%ICU_PATH%\bin;%PATH% 
    set INCLUDE=%ICU_PATH%\include;%INCLUDE%
    set LIB=%ICU_PATH%\lib;%LIB%
    set INCLUDE=%OPENSSL_PATH%\include;%INCLUDE%
    set LIB=%OPENSSL_PATH%\lib;%LIB%
    
    cd qtbase-opensource-src-5.4.1
    call configure.exe -prefix %PREFIX% -libdir %LIBDIR% -plugindir %LIBDIR% -qtlibinfix %INFIX% -release -opensource -confirm-license ^
    	-no-sql-mysql -no-sql-psql -no-sql-oci -no-sql-odbc -no-sql-tds -no-sql-db2 -qt-sql-sqlite -no-sql-sqlite2 -no-sql-ibase ^
    	-no-plugin-manifests -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 ^
    	-no-ltcg -no-nis -no-iconv -no-evdev -no-mtdev -no-inotify -no-fontconfig ^
    	-qt-zlib -icu -no-gif -qt-libpng -qt-libjpeg -qt-freetype -no-harfbuzz -no-angle ^
    	-openssl-linked -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug -no-directwrite -no-direct2d ^
    	-qt-style-windowsvista -no-style-windowsce -no-style-windowsmobile ^
    	-no-native-gestures -no-mp -opengl desktop ^
    	-nomake examples -nomake tests
    
    nmake
    nmake install
  • Build Qt UiTools library with previously built qmake tool
    Shell commands
    cd qttools-opensource-src-5.4.1\src\designer\src
    set QMAKESPEC=win32-msvc2013
    call %VS120COMNTOOLS%vsvars32.bat
    qmake
    nmake
    nmake install
  • Build Qt WebKit libraries.
    1. Install ruby
    2. Install GNUWin32
    3. Install SQLite. For SQLite, download the 'amalgamation' sources and make sure you set SQLITE3SRCDIR environment variable to the directory containing the source files. (You could also set %SQLITE3SRCDIR% to the sources in your Qt's base source directory src/3rdparty/sqlite)
    4. Build QtWebKit and QtWebKitWidgets libraries with the following batch script, changing variables with the real pathes
      Shell commands
      set QMAKESPEC=win32-msvc2013
      call %VS120COMNTOOLS%vsvars32.bat
      set PATH=%CYGWIN_PATH%\bin;%PATH%
      set PATH=%PERL_PATH%\bin;%PATH%
      set PATH=%RUBY_PATH%\bin;%PATH%
      set PATH=%GNUWIN32_PATH%\bin;%PATH%
      set PATH=%ICU_PATH%\bin;%PATH%
      set INCLUDE=%ICU_PATH%\include;%INCLUDE%
      set LIB=%ICU_PATH%\lib;%LIB%
      set SQLITE3SRCDIR=%SQLITE_PATH%
      
      cd qtwebkit-opensource-src-5.4.1
      call perl Tools\Scripts\build-webkit --qt --release --minimal
      cd WebKitBuild\Release
      call nmake install

Build Qt for Linux

Preparation

  • Build ICU libraries:
    1. Download ICU source code
    2. Unpack and build ICU with the following shell script
      Shell commands
      cd icu/source
      ./configure --enable-static --disable-shared
      make
      make install

  • Build OpenSSL 1.0.2 libraries:
    1. Download OpenSSL v1.0.2 source code
    2. Unpack and build
      Shell commands
      cd openssl-1.0.2
      ./config no-shared -fPIC
      make
      make install

Build

Download sources of Qt modules and unpack them

qtbase-opensource-src-5.4.1.tar.gz

qttools-opensource-src-5.4.1.tar.gz

qtwebkit-opensource-src-5.4.1.tar.gz

  • Build Qt base libraries with the script
    Shell commands
    PREFIX=../
    LIBDIR=../lib
    INFIX=Unigine_x64
    cd ./qtbase-opensource-src-5.4.1
    ./configure -verbose -prefix $PREFIX -libdir $LIBDIR -plugindir $LIBDIR -qtlibinfix $INFIX -release -opensource -confirm-license \
    	-I$PWD/../icu/include -I$PWD/../openssl/include -L$PWD/../icu/lib -L$PWD/../openssl/lib -ldl \
    	-no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -qt-sql-sqlite -no-sql-sqlite2 -no-sql-tds \
    	-no-qml-debug -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 \
    	-qt-zlib -no-mtdev -no-gif -qt-libpng -qt-libjpeg -qt-freetype -no-harfbuzz -openssl-linked \
    	-qt-pcre -no-xinput2 -no-glib -no-pulseaudio -no-alsa -no-gtkstyle \
    	-no-nis -no-cups -no-iconv -no-evdev -icu -fontconfig -no-pch -no-dbus \
    	-qt-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms \
    	-qpa xcb -opengl desktop \
    	-nomake examples -nomake tests
    
    make -j 8
    make install
  • Build Qt UiTools library with previously built qmake tool
    Shell commands
    cd qttools-opensource-src-5.4.1\src\designer\src
    qmake
    make
    make install
  • Build Qt WebKit libraries with the script included:
    Shell commands
    cd qtwebkit-opensource-src-5.4.1
    ./Tools/Scripts/build-webkit --qt --release --minimal --makeargs="-j8"
    cd ./WebKitBuild/Release
    make install
  • After build is successful, run the next script from the directory with Qt libraries:
    Shell commands
    MAJOR=5
    MINOR=4
    VER=1
    for i in *.la *.prl *_x64.so *_x64.so.$MAJOR.$MINOR; do
    	rm $i
    done
    for i in *_x64.so.$MAJOR.$MINOR.$VER; do
    	mv $i ${i/so.$MAJOR.$MINOR.$VER/so.$MAJOR}
    done
    for i in *_x64.so.$MAJOR; do
    	ln -s $i ${i/so.$MAJOR/so}
    done

Build Qt for Mac OS X

Preparation

  • Build OpenSSL 1.0.2 libraries:
    1. Download OpenSSL v1.0.2 source code
    2. Unpack and build
      Shell commands
      cd openssl-1.0.2
      ./Configure darwin64-x86_64-cc no-shared
      make
      make install

Build

Download sources of Qt modules and unpack them

qtbase-opensource-src-5.4.1.tar.gz

qttools-opensource-src-5.4.1.tar.gz

qtwebkit-opensource-src-5.4.1.tar.gz

  • Build Qt base libraries with the script
    Shell commands
    PREFIX=../
    LIBDIR=../lib
    INFIX=Unigine_x64
    cd ./qtbase-opensource-src-$VERSION
    ./configure -verbose -prefix $PREFIX -libdir $LIBDIR -plugindir $LIBDIR -qtlibinfix $INFIX -release -opensource -confirm-license \
    	-no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -qt-sql-sqlite -no-sql-sqlite2 -no-sql-tds \
    	-no-qml-debug -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 \
    	-qt-zlib -no-mtdev -no-gif -qt-libpng -qt-libjpeg -qt-freetype -no-harfbuzz -openssl-linked \
    	-qt-pcre -no-xinput2 -no-glib -no-pulseaudio -no-alsa -no-gtkstyle \
    	-no-nis -no-cups -no-iconv -no-evdev -no-icu -fontconfig -no-pch -no-dbus \
    	-no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms \
    	-qpa cocoa -opengl desktop -no-framework \
    	-nomake examples -nomake tests
    
    make -j 8
    make install
  • Build Qt UiTools library with previously built qmake tool
    Shell commands
    cd qttools-opensource-src-$VERSION\src\designer\src
    qmake
    make
    make install
  • Build Qt WebKit libraries with the script included.
    Shell commands
    cd qtwebkit-opensource-src-5.4.1
    ./Tools/Scripts/build-webkit --qt --release --minimal --makeargs="-j8"
    cd ./WebKitBuild/Release
    make install
  • After build is successful, run the next script in the directory with Qt libraries:
    Shell commands
    PREFIX=$PWD
    NAMES=''
    MAJOR=5
    MINOR=4
    VER=1
    for i in *.la *.prl *_x64.dylib *_x64.$MAJOR.$MINOR.dylib; do
    	rm $i
    done
    for i in *_x64.$MAJOR.$MINOR.$VER.dylib; do
    	mv $i ${i/$MAJOR.$MINOR.$VER.dylib/$MAJOR.dylib}
    done
    for i in *_x64.$MAJOR.dylib; do
    	ln -s $i ${i/$MAJOR.dylib/dylib}
    done
    for i in *.$MAJOR.dylib; do
    	install_name_tool -id @rpath/$i $i
    	for j in *.$MAJOR.dylib; do
    		install_name_tool -change $PREFIX/$j @rpath/$j $i
    	done
    	NAMES="$NAMES $i"
    done
    cd ./platforms
    for i in *.dylib; do
    	for j in $NAMES; do
    		install_name_tool -change $PREFIX/$j @rpath/$j $i
    	done
    done
Last update: 2017-07-03