1. 准备:
    1. qt源码下载:https://download.qt.io/archive/qt/5.15/5.15.2/single/ 并解压image.png
    2. python下载安装

image.png
image.png
image.png

  1. 安装Ruby

    image.png
    image.png
    image.png

  1. 创建脚本文件 https://www.cryfeifei.cn/2020/06/28/qt-compile-windows/ 执行脚本,修改配置文件,生成makefile

    1. //指定了安装路径-prefix "D:\QtVersion\Qt5.13_Build_MT_X64\qt5.13_build_mt"
    2. configure -confirm-license -opensource -debug -prefix "D:\QtVersion\Qt5.13_Build_MT_X64\qt5.13_build_mt" -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -no-compile-examples -nomake examples
    3. //未指定安装路径-prefix "D:\QtVersion\Qt5.13_Build_MT_X64\qt5.13_build_mt"
    4. configure -confirm-license -opensource -debug -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -no-compile-examples -nomake examples
  2. 输入nmake,执行makefile

  3. nmake install 安装,前面执行的未指定安装路径,这里默认安装C盘。

configure -confirm-license -opensource -debug -prefix “D:\Qt\Qt5.15.2\x64” -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake tests -no-compile-examples -nomake examples

方式二

image.png

  1. 下载源码并解压
  2. 创建.cmd文件

    1. SET _ROOT=D:\Qt\qt-everywhere-src-5.15.2
    2. SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
  3. 调用vs工具

image.png
configure -debug -nomake examples -nomake tests -opensource -prefix D:\Qt\Qt5.15.2\x64
nmake
nmake install

直接安装
https://mirrors.tuna.tsinghua.edu.cn/qt/official_releases/online_installers/
image.png