本页内容

Conan 包管理器

该实验性 Conan 插件集成了 Conan 包管理器。

Conan是一款 C/C++ 包管理器,可加快将 C 或 C++ 库集成到您自己的项目中的速度。它可在所有受支持的开发平台上使用。

Conan 可集成到大多数已集成到Qt Creator 中的构建系统中:

Conan 的客户端-服务器架构使客户端能够从充当软件包存储库的远程服务器获取软件包,并将其上传至这些服务器。客户端负责创建软件包,并在必要时处理从源代码进行构建。由于客户端拥有用于存储软件包的本地缓存,只要不需要从远程服务器获取新软件包,您就可以离线工作。

要使用 Conan,请通过 Qt Online Installer 或使用操作系统自带的工具进行安装。例如,在 Windows 系统上,您可以使用choco install conanpip install conan 命令。

注意:需启用 Conan 插件才能使用它。

对于每个项目,您必须编写一个 conanfile.pyconanfile.txt 文件,以指定所需的库和包。随后,您需要编辑项目的构建设置,指定该文件的位置以及 Conan 安装命令的内容。

自动配置包管理器

若要自动配置 Conan 包管理器以便与 CMake 配合使用,请转至Projects >Project Settings >CMake ,并选择“Package manager auto setup ”。

PackageManagerAutoSetup false 若要关闭自动包管理器设置,请在CMake 预设或某个 CMakeLists.txt.shared 文件中。

另请参阅 Conan 构建配置启用和禁用插件为项目覆盖 CMake 设置,以及在包管理器中使用 CMake

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.