Filesystem registries 使用示例

创建注册表

参考 https://github.com/PhoebeHui/filesystem  及以下文件结构来创建文件及文件夹,或者克隆官方示例库https://github.com/vcpkg/example-filesystem-registry

filesystem/
|-- ports/
|-------- beicode/
|--------------1.0.0/
|---------------- portfile.cmake
|---------------- vcpkg.json
|--------- beison/
|-------------- 1.0.0/
|---------------- portfile.cmake
|---------------- vcpkg.json
|-------------- 1.0.1/
|---------------- portfile.cmake
|---------------- vcpkg.json
|-- versions/
| -------- baseline.json
|--------- b-/
|------------ beicode.json
|------------ beison.json

使用注册表(manifest模式)

1. 创建Vcpkg-configuration.json 与vcpkg.json文件, 为了方便测试,可以把它放置到vcpkg根目录。实际使用时,请放置在您项目的工程项目与vcpkg.json同级目录下。

vcpkg-configuration.json文件:

{
   "registries": [
    {
      "kind": "filesystem",
      "baseline": "2021-04-08",
      "path": "E:/vcpkg/vcpkgtest/registries/filesystem",
      "packages": [ "beicode", "beison"]
    }
  ]
}

vcpkg.json 文件:

{
  "name": "test",
  "version": "0",
  "dependencies": [
      "beicode",
      "beison"
   ]
}

2. 安装使用,可以看到,它安装了注册表配置的库。

PS E:\vcpkg\clean\vcpkg> ./vcpkg install --triplet=x64-windows
Detecting compiler hash for triplet x64-windows...
The following packages will be built and installed:

    beicode[core]:x64-windows -> 1.0.0 -- E:/vcpkg/vcpkgtest/registries/filesystem\ports/beicode/1.0.0
    beison[core]:x64-windows -> 1.0.1 -- E:/vcpkg/vcpkgtest/registries/filesystem\ports/beison/1.0.1

Using cached binary package: C:\Users\phoebe\AppData\Local\vcpkg\archives\df\df818eb2474ab4e697ccbb6876ad31d41aa6a6008c938225856014ca82881e02.zip
Could not locate cached archive: C:\Users\phoebe\AppData\Local\vcpkg\archives\66\66899286c8a08d5310336ed80de170053d24220cc4b0e464fb90521c58b094ed.zip
...

使用注册表(经典模式)

1. 在vcpkg根目录下创建文件 vcpkg-configuration.json:

{
   "registries": [
    {
      "kind": "filesystem",
      "baseline": "2021-04-08",
      "path": "E:/vcpkg/vcpkgtest/registries/filesystem",
      "packages": [ "beicode", "beison"]
    }
  ]
}

2. 安装beicode库。

PS E:\vcpkg\clean\vcpkg> ./vcpkg install beicode
Computing installation plan...
The following packages will be built and installed:
    beicode[core]:x86-windows -> 1.0.0 -- E:/vcpkg/vcpkgtest/registries/filesystem\ports/beicode/1.0.0

Detecting compiler hash for triplet x86-windows...
Could not locate cached archive: C:\Users\phoebe\AppData\Local\vcpkg\archives\af\af12a6c0126c79f715ae3940197c60e56a9845ecd605a07c041b0ffe61009e09.zip
Starting package 1/1: beicode:x86-windows
...

首次发布于https://www.cnblogs.com/vcpkg/p/15167906.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值