From 6b7ad24669ade652921bf6243cd47694648e1050 Mon Sep 17 00:00:00 2001 From: Johannes Winkler <35803880+jowin202@users.noreply.github.com> Date: Thu, 11 Apr 2024 04:30:04 +0200 Subject: [PATCH] Qt6 static build on windows with submodules (#19) * Create Dockerfile.win64sm This Dockerfile prepares and environment for building Qt6 static applications on Win64 with modules like multimedia and serial port * Update README.md Add Submodule build --- Dockerfile.win64sm | 23 +++++++++++++++++++++++ README.md | 9 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile.win64sm diff --git a/Dockerfile.win64sm b/Dockerfile.win64sm new file mode 100644 index 0000000..e4103ed --- /dev/null +++ b/Dockerfile.win64sm @@ -0,0 +1,23 @@ +FROM fffaraz/qt:mxe + +RUN \ + cd /opt/mxe && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-conf && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-qtcharts && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-qtsvg && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-qttools && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-qtwebsockets && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-qtserialport && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-qtmultimedia && \ + make --jobs=$(nproc) JOBS=$(nproc) MXE_TARGETS='x86_64-w64-mingw32.static' qt6-qtbase && \ + exit 0 + +ENV PATH="${PATH}:/opt/mxe/usr/x86_64-w64-mingw32.static/qt6/bin" + +RUN \ + set -eux && \ + echo $PATH && \ + ln -s /opt/mxe/usr/bin/x86_64-w64-mingw32.static-cmake /usr/local/bin/cmake && \ + cmake --version && \ + qmake --version && \ + exit 0 diff --git a/README.md b/README.md index 028fc01..a117dc7 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,12 @@ cd /app qmake make -j $(nproc) ``` + +* Windows 64bit Cross-compiled Statically Linked with Qt6 Submodules (Multimedia, Serialport, ...) +``` +docker build --force-rm -f Dockerfile.win64sm -t fffaraz/qt:win64sm . +docker run --rm -it -v $(pwd):/app fffaraz/qt:win64sm +cd /app +qmake +make -j $(nproc) +```