Conan —— 开源 C/C++ 包管理器
Conan 是一个去中心化、开源 (MIT)、C/C++ 包管理器。
- 它是完全去中心化的,用户可以私下将他们的包托管在他们的服务器上
- 适用于所有平台,包括 Linux、OSX、Windows、Solaris、FreeBSD、Docker、WSL
- 管理二进制文件。 它可以为任何配置和平台创建、上传和下载二进制文件, 甚至交叉编译,节省大量的开发和持续集成时间。
- 与任何构建系统集成,包括任何专有和自定义系统。
- 可扩展:具有强大的功能和灵活性
设置
$ pip install conan
安装开发版本
可以在 Windows、macOS 和 Linux 中运行 Conan 客户端和服务器
安装 pip
克隆 Conan 仓库:
$ git clone https://github.com/conan-io/conan.git conan-io
注意:存储库目录名称很重要,已知某些目录在运行测试时会出现问题
以可编辑模式安装
$ cd conan-io && sudo pip install -e .
如果安装在 Windows 中,则不需要使用
sudo尝试运行 Conan:
$ conan --help
Consumer commands
install Installs the requirements specified in a recipe (conanfile.py or conanfile.txt).
config Manages Conan configuration.
get Gets a file or list a directory of a given reference or package.
info Gets information about the dependency graph of a recipe.
search Searches package recipes and binaries in the local cache or a remote. Unless a
remote is specified only the local cache is searched.
Creator commands
new Creates a new package recipe template with a 'conanfile.py' and optionally,
'test_package' testing files.
create Builds a binary package for a recipe (conanfile.py).
upload Uploads a recipe and binary packages to a remote.
export Copies the recipe (conanfile.py & associated files) to your local cache.
export-pkg Exports a recipe, then creates a package from local source and build folders.
test Tests a package consuming it from a conanfile.py with a test() method.
Package development commands
source Calls your local conanfile.py 'source()' method.
build Calls your local conanfile.py 'build()' method.
package Calls your local conanfile.py 'package()' method.
editable Manages editable packages (packages that reside in the user workspace, but are
consumed as if they were in the cache).
workspace Manages a workspace (a set of packages consumed from the user workspace that
belongs to the same project).
Misc commands
profile Lists profiles in the '.conan/profiles' folder, or shows profile details.
remote Manages the remote list and the package recipes associated with a remote.
user Authenticates against a remote with user/pass, caching the auth token.
imports Calls your local conanfile.py or conanfile.txt 'imports' method.
copy Copies conan recipes and packages to another user/channel.
remove Removes packages or binaries matching pattern from local cache or remote.
alias Creates and exports an 'alias package recipe'.
download Downloads recipe and binaries to the local cache, without using settings.
inspect Displays conanfile attributes, like name, version, and options. Works locally,
in local cache and remote.
help Shows help for a specific command.
lock Generates and manipulates lock files.
frogarian Conan The Frogarian
Conan commands. Type "conan <command> -h" for help