构建 Qt 源

You can install Qt by building Qt sources. This is useful if, for example:

  • You need a custom build (for example, with patches or debug options).
  • Your platform isn't supported by pre-built packages.
  • You're contributing to Qt or debugging its internals.

注意: In most use cases, other than those listed above, the best way to install Qt is with Qt Online Installer. See 采用 Qt 在线安装程序获取和安装 Qt .

The installation procedure is different on each Qt platform. This page provides relevant information for the supported platforms and links to module-specific system requirements.

一般安装信息

When you build Qt sources, you use the configure tool to configure Qt for a particular platform with a particular set of Qt features or modules. For more information, see Qt 配置选项 .

The Build and Installation Process

A brief overview of the build and installation process:

  1. Download the Qt source code and set up the initial environment.
  2. Configure the build according to the use case, such as development on the host system or cross-compilation for a target platform.
  3. Build (compile) in a separate directory.
  4. Optional. Install the built artifacts.

Platform-Specific Installation Information

Windows

macOS

Linux/X11

嵌入式 Linux

Android

iOS

Module-specific System Requirements

附加信息

顶级 Qt5 Git 存储库包含一组构建指令,采用形式 供应脚本 , used by Qt's continuous integration (CI) system to build and test the 支持平台 。这些脚本对于从源代码构建 Qt 的任何人是有用的,因为它们为每种配置提供所需的工具和组件的相关信息。