选择构建系统
您可以使用多种构建系统来构建项目:
- CMake是一种跨平台的自动化构建系统,有助于简化不同平台开发项目的构建流程。它能自动生成构建配置。更多信息,请参阅CMake。
- qmake是 CMake 的替代品,用于自动生成构建配置。Qt 安装程序会安装并配置 qmake。要使用其他受支持的构建系统,您需要对其进行设置。
- Meson是一个快速、用户友好的开源构建系统,旨在尽量减少开发人员编写或调试构建定义以及等待构建系统开始编译代码的时间。更多信息,请参见Meson。
- Qbs是一款多合一的构建工具,它能根据高级项目描述生成构建图(就像 qmake 或 CMake 所做的那样),并执行底层构建图中的命令(就像 make 所做的那样)。更多信息,请参阅构建系统:Qbs.
通常,你会在创建项目时选择构建系统。
迁移到其他构建系统
要将项目导出到其他构建系统(如 Microsoft Visual Studio),请选择Build >Run Generator ,然后在列表中选择一个生成器。Qt Creator 生成项目构建目录中的构建文件(如 .vcxproj)。
用于构建项目的工具(qmake 或 CMake)会提供生成器。生成器的可用性取决于构建工具的版本、主机平台和主机系统的属性。此外,如果启用了Clang Code Model 插件(默认),还可使用 JSON 编译数据库生成器。
设置构建和运行首选项
要更改项目目录的位置并指定构建和运行项目的设置,请选择首选项>Build & Run >General 。
在Projects 模式下,为不同目标平台指定构建和运行设置。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.