conanfile.txt 中拉取两个包,分别来自两个仓库
时间: 2023-12-09 18:02:40 浏览: 39
在Conan中,您可以使用conanfile.txt文件指定依赖项和仓库。如果您需要指定来自不同仓库的依赖项,可以在conanfile.txt文件中添加以下内容:
```
[requires]
package1/version1@remote_name1/stable
package2/version2@remote_name2/testing
[remotes]
remote_name1 = https://url.to.remote1
remote_name2 = https://url.to.remote2
```
其中,[requires]部分列出了需要拉取的两个包及其对应的远程仓库名称,使用`@`符号进行分割,后面的`stable`和`testing`是包的版本。[remotes]部分列出了每个远程仓库的URL。
例如,如果您要从bincrafters仓库拉取Catch2和spdlog两个包,可以在conanfile.txt文件中添加以下内容:
```
[requires]
Catch2/2.13.6@bincrafters/stable
spdlog/1.8.5@bincrafters/stable
[remotes]
bincrafters = https://api.bintray.com/conan/bincrafters/public-conan
```
这将添加一个名为“bincrafters”的远程仓库,并将其URL设置为https://api.bintray.com/conan/bincrafters/public-conan。您可以将Catch2和spdlog添加到您的项目中,并使用远程仓库中的稳定版本。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)