conan info 命令的基本用法
conan info
命令用于获取有关包的依赖关系图的信息。以thrift
为例,如下查询thrift/0.13.0
的依赖关系详情:
$ conan info thrift/0.13.0@
boost/1.78.0
ID: ff68d7a235dfb0d14c40ddef58cc716150cba5f6
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
URL: https://github.com/conan-io/conan-center-index
Homepage: https://www.boost.org
License: BSL-1.0
Description: Boost provides free peer-reviewed portable C++ source libraries
Topics: libraries, cpp
Provides: boost
Recipe: Cache
Binary: Missing
Binary remote: conancenter
Creation date: 2022-02-21 16:11:05 UTC
Required by:
thrift/0.13.0
Requires:
zlib/1.2.11
bzip2/1.0.8
bzip2/1.0.8
ID: d9d4b222f9e8db0529bc4a08685d8a80c5b6eadb
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
URL: https://github.com/conan-io/conan-center-index
Homepage: http://www.bzip.org
License: bzip2-1.0.8
Description: bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm.
Topics: bzip2, data-compressor, file-compression
Provides: bzip2
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-24 21:45:30 UTC
Required by:
boost/1.78.0
libevent/2.1.12
ID: 00ca1cc2eae480d2d07a9224b72d320c5b3fae8d
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/libevent/libevent
License: BSD-3-Clause
Description: libevent - an event notification library
Topics: event, notification, networking, async
Provides: libevent
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-23 04:11:00 UTC
Required by:
thrift/0.13.0
Requires:
openssl/1.1.1m
openssl/1.1.1m
ID: 63da998e3642b50bee33f4449826b2d623661505
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/openssl/openssl
License: OpenSSL
Description: A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols
Topics: openssl, ssl, tls, encryption, security
Provides: openssl
Recipe: Cache
Binary: Missing
Binary remote: conancenter
Creation date: 2022-02-25 20:23:27 UTC
Required by:
libevent/2.1.12
thrift/0.13.0
thrift/0.13.0
ID: f2d1fdb95bb1e441f36c5f3675d1631dc13bbfbf
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/apache/thrift
License: Apache-2.0
Description: Thrift is an associated code generation mechanism for RPC
Topics: thrift, serialization, rpc
Provides: thrift
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-12 18:22:36 UTC
Requires:
boost/1.78.0
openssl/1.1.1m
zlib/1.2.11
libevent/2.1.12
zlib/1.2.11
ID: 63da998e3642b50bee33f4449826b2d623661505
BuildID: None
Context: host
Remote: conancenter=https://center.conan.io
URL: https://github.com/conan-io/conan-center-index
Homepage: https://zlib.net
License: Zlib
Description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)
Topics: zlib, compression
Provides: zlib
Recipe: Cache
Binary: Download
Binary remote: conancenter
Creation date: 2022-01-25 09:24:47 UTC
Required by:
thrift/0.13.0
boost/1.78.0
指定--graph
参数可以生成依赖关系图
$ conan info thrift/0.13.0@ -r conancenter --graph d:\tmp\info.html
用Chrome浏览器打开生成的info.html,如下:
包名末尾的
@
符号对于搜索特定包很重要。如果不添加@
,柯南会将参数解释为模式搜索(模糊匹配),并返回所有匹配thrift/0.13.0
的包,并且可能有不同的用户和频道。
需要说明的是,上面的示例中我们给conan info
命令的第一个参数是个包名thrift/0.13.0@
指定要获取 thrift/0.13.0
的依赖信息。
如果这个参数是个包含conanfile.py或conanfile.txt的路径,一样是有效的。
比如我们要获取自己的项目的依赖关系图,可以用:
$ conan info.
$ conan info./conanfile.txt
$ conan info./conanfile.py
这里.
代表当前文件夹(必须有conanfile.py或conanfile.txt),关于这部分可以参考Conan官方更详细的说明《Inspecting Dependencies》
参考资料
conan系列文章
《conan入门(一):conan 及 JFrog Artifactory 安装》
《conan入门(二):conan 服务配置-密码管理及策略》
《conan入门(三):上传预编译的库(artifact)》
《conan入门(四):conan 引用第三方库示例》
《conan入门(五):conan 交叉编译引用第三方库示例》
《conan入门(六):conanfile.txt conanfile.py的区别》
《conan入门(七):将自己的项目生成conan包》
《conan入门(八):交叉编译自己的conan包项目》
《conan入门(九):NDK交叉编译自己的conan包项目塈profile的定义》
《conan入门(十):Windows下Android NDK交叉编译Boost》
《conan入门(十一):Linux下Android NDK交叉编译Boost》
《conan入门(十二):Windows NDK 编译 boost报错:CMake was unable to find a build program … MinGW Makefile》
《conan入门(十三):conan info 命令的基本用法》
《conan入门(十四):conan new 命令的新特性–模板功能(–template)》
《conan入门(十五):AttributeError: ‘CMake‘ object has no attribute ‘definitions‘》
《conan入门(十六):profile template功能实现不同平台下profile的统一》
《conan入门(十七):支持android NDK (armv7,armv8,x86,x86_64)交叉编译的统一profile jinja2模板》
《conan入门(十八):Cannot recognize the Windows subsystem, install MSYS2/cygwin or specify a build_require》
《conan入门(十九):封装第三方开源库cpp_redis示例》
《conan入门(二十):封装只包含头文件(header_only)的库示例》
《conan入门(二十一):解决MinGW编译Openssl的编译错误:crypto/dso/dso_win32.c》
《conan入门(二十二):编译 openssl要求python 3.7以上版本》
《conan入门(二十三):Windows下MinGW编译libcurl》
《conan入门(二十四):通过CONAN_DISABLE_CHECK_COMPILER禁用编译器检查》
《conan入门(二十五):imports将包安装到本地项目或其他指定位置》
《conan入门(二十六):使用make编译makefile》
《conan入门(二十七):因profile [env]字段废弃导致的boost/1.81.0 在aarch64-linux-gnu下交叉编译失败》
《conan入门(二十八):解决conan 1.60.0下 arch64-linux-gnu交叉编译openssl/3.1.2报错问题》
《conan入门(二十九):对阿里mnn进行Conan封装塈conans.CMake和conan.tools.cmake.CMake的区别》
《conan入门(三十):对腾讯ncnn进行Conan封装》
《conan入门(三十一):在命令行(shell)中从profile中读取配置参数》
《conan 入门(三十二):package_info中配置禁用CMakeDeps生成使用项目自己生成的config.cmake》
《conan 入门(三十三):requirements()指定header的可见性(transitive_headers)》
《conan 入门(三十四):conan 2.x实现对只有Makefile的项目(erpcgen)的封装示例》
《conan 入门(三十五):在conanfile.py中获取C++编译器完整路径的方法》
《conan入门(三十六):在set_version方法中从pom.xml中读取版本号实现动态版本定义》
《conan 入门(三十七):conan 2.x通过定义环境变量(environment)执行make编译只有Makefile的项目(erpcgen)》
《conan 入门(三十八):conan二进制包的兼容性及自定义package_id的方式》
《conan入门(三十九):conan 2.x 引用第三方库示例》