在此页面上

CMake

CMake可自动配置构建系统。它通过使用简单的配置文件(称为CMakeLists.txt 文件)来控制软件编译过程。CMake 可生成本地编译配置和工作区,供您在所选的编译器环境中使用。

您可以从Qt Creator 使用 CMake 构建桌面、移动和嵌入式设备的应用程序。或者,构建单个文件来测试您的更改。

支持的 CMake 版本

Qt Creator 您需要使用 CMake基于文件的 API,因此您需要 CMake 3.14 或更高版本。

对于使用旧版 CMake 的系统,只能使用变通方法:

  • 对于 CMake 3.5 或更高版本,请生成一个编译数据库并在Qt Creator 中打开,如使用编译数据库中所述。
  • 使用qmake -project 为 qmake 编译创建一个临时项目文件,并在Qt Creator打开该文件。通常情况下,如果不进行手动修改,就无法编译此类项目。
  • 通用项目手动创建临时项目文件,并在Qt Creator 中打开。通常情况下,如果不进行手动修改,就无法编译此类项目。

另请参阅 为构建配置项目为运行配置项目如何使用 CMake构建使用 CMake构建项目 :使用 CMake 构建,使用 CMake 构建项目,调试 CMake 项目文件, 将应用程序部署到远程 Linux 设备,打开项目,使用编译数据库

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.