conan入门(十三):conan info 命令的基本用法

Posted 10km

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了conan入门(十三):conan info 命令的基本用法相关的知识,希望对你有一定的参考价值。

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 search》

《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 info 命令的基本用法的主要内容,如果未能解决你的问题,请参考以下文章

conan入门(十四):conan new 命令的新特性--模板功能(--template)

conan入门(二十四):通过CONAN_DISABLE_CHECK_COMPILER禁用编译器检查

conan入门(十五):AttributeError: ‘CMake‘ object has no attribute ‘definitions‘

conan入门:将自己的项目生成conan包

conan入门:交叉编译自己的conan包项目

conan入门:conan 引用第三方库示例