# HG changeset patch # User Matti Hamalainen # Date 1491219163 -10800 # Node ID 0ade5c3e424cd4248c66db5e22d289398b216c03 # Parent 55674cf632fba5a17075ba5b73753fd3ce77af9a Some loose instructions for cross-building for Windows on Debian 9. diff -r 55674cf632fb -r 0ade5c3e424c qt5-cross-build.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qt5-cross-build.txt Mon Apr 03 14:32:43 2017 +0300 @@ -0,0 +1,50 @@ +# In Debian 9 +apt-get install gcc-mingw-w64 g++-mingw-w64 + + +# Clone Qt5 base git repo: +git clone https://code.qt.io/qt/qt5.git qt5-src +cd qt5-src/ + +# Checkout desired version +git checkout 5.8 + +# Initialize subrepos, we need just qtbase +./init-repository -f --module-subset=qtbase +git checkout v5.8.0 +git submodule update + +# Configure for cross-compilation +./configure -release -opensource -nomake examples -nomake tests -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- -opengl desktop + +# Qt5.8 requires this Windows 10 -specific header file +wget https://raw.githubusercontent.com/tpn/winsdk-10/master/Include/10.0.10240.0/um/UIViewSettingsInterop.h + -O /usr/i686-w64-mingw32/include/ + +# Build it +make -j8 + + +# To cross-compile using qmake +/misc/packages/qt5-src/qtbase/bin/qmake +make + + +# The compiled exe requires DLL libraries ( Qt5Core.dll Qt5Gui.dll Qt5Widgets.dll +# ) etc. which can be found from the QT5 cross build directory. Copy them +# into your application (executable) directory. +/misc/packages/qt5-src/qtbase/bin/ + + +# And plugins, usually platforms/qwindows.dll and whatever you need, +# but it depends on your application. You will have to create the +# same subdirectories under your target application directory. + +mkdir -p $TGTDIR/platforms +cp /misc/packages/qt5-src/qtbase/plugins/platforms/qwindows.dll $TGTDIR/platforms/ + + +# Also libgcc and libstdc++ DLLs are needed, found from +/usr/lib/gcc/i686-w64-mingw32/6.3-win32/ + +# or so ..