本文档翻译自:https://docs.conan.io/en/latest/getting_started.html#inspecting-dependencies
检查本地缓存包(通常是 .conan/data),并且可以从该位置重用于其他项目。这样,即使没有网络连接,也可以清理当前项目并继续工作。要在本地缓存中搜索包,请运行:
$ conan search "*"
Existing package recipes:
openssl/1.0.2t
poco/1.9.4
zlib/1.2.11
要检查参考运行的不同二进制包:
$ conan search poco/1.9.4@
Existing packages for recipe poco/1.9.4:
Package_ID: 645aaff0a79e6036c77803601e44677556109dd9
[options]
cxx_14: False
enable_apacheconnector: False
enable_cppparser: False
enable_crypto: True
enable_data: True
...
包名称末尾的 @
符号对于搜索特定的包很重要。如果您不添加 @
,则Conan会将参数解释为模式搜索,并返回所有与 poco/1.9.4
匹配的包。
要检查当前项目的所有依赖包,请使用 conan info
命令,将其指向 conanfile.txt 文件夹的位置:
$ conan info ..
conanfile.txt
ID: db91af4811b080e02ebe5a626f1d256bb90d5223
BuildID: None
Requires:
poco/1.9.4
openssl/1.0.2t
ID: eb50d18a5a5d59bd0c332464a4c348ab65e353bf
BuildID: None
Remote: conan-center=https://api.bintray.com/conan/conan/conan-center
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: conan, openssl, ssl, tls, encryption, security
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2019-11-13 23:14:37
Required by:
poco/1.9.4
Requires:
zlib/1.2.11
poco/1.9.4
ID: 645aaff0a79e6036c77803601e44677556109dd9
BuildID: None
Remote: conan-center=https://api.bintray.com/conan/conan/conan-center
URL: https://github.com/conan-io/conan-center-index
Homepage: https://pocoproject.org
License: BSL-1.0
Description: Modern, powerful open source C++ class libraries for building network- and internet-based applications that run on desktop, server, mobile and embedded systems.
Topics: conan, poco, building, networking, server, mobile, embedded
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-01-07 17:29:24
Required by:
conanfile.txt
Requires:
openssl/1.0.2t
zlib/1.2.11
ID: f74366f76f700cc6e991285892ad7a23c30e6d47
BuildID: None
Remote: conan-center=https://api.bintray.com/conan/conan/conan-center
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)
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-01-07 17:01:29
Required by:
openssl/1.0.2t
或使用Dot或HTML格式生成依赖关系图:
$ conan info .. --graph=file.html
$ file.html # or open the file, double-click