# Use vcpkg

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/)
- [Install vcpkg](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/installation/)
- [Initialize vcpkg](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/initialization/)
- [Create a vcpkg-configuration.json file](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/config_creation/)
- [Use vcpkg](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/usage/)
- [Activate a license](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/licenseactivation/)
- [Remove vcpkg](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/removal/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/vcpkg-tool-installation/_next-steps/)

The following commands help you to work with `vcpkg`. The most important one is `activate` as this activates all tools specified by the configuration file.

## Activate vcpkg

### Activate tools specified by vcpkg-configuration.json

```
vcpkg-shell activate
__output__
__output__ warning: vcpkg-artifacts is experimental and may change at any time.
__output__ Artifact                                Version Status    Dependency Summary
__output__ arm:tools/open-cmsis-pack/cmsis-toolbox <span>2.0</span>.0   installed            Arm distributed Open-CMSIS-Pack cli tools
__output__ arm:compilers/arm/armclang              <span>6.20</span>.0  installed            Arm Compiler <span>for</span> Embedded
__output__ microsoft:tools/kitware/cmake           <span>3.25</span>.2  installed            Kitware's cmake tool
__output__ microsoft:tools/ninja-build/ninja       <span>1.10</span>.2  installed            Ninja is a small build system with a focus on speed.
```

### Deactivate artifacts specified by vcpkg-configuration.json

```
vcpkg-shell deactivate
__output__
__output__ warning: vcpkg-artifacts is experimental and may change at any time.
__output__ Deactivating: /Users/myuser/projects/myproject
```

### Activating tools without vcpkg-configuration.json

```
vcpkg-shell use cmsis-toolbox
__output__
__output__ warning: vcpkg-artifacts is experimental and may change at any time.
__output__ Artifact                                Version Status    Dependency Summary
__output__ arm:tools/open-cmsis-pack/cmsis-toolbox <span>2.0</span>.0   installed            Arm distributed Open-CMSIS-Pack cli tools
```

### Retrieve all available versions of a tool

```
vcpkg-shell use open-cmsis-pack
__output__
__output__ warning: vcpkg-artifacts is experimental and may change at any time.
__output__ error: Unable to resolve artifact: open-cmsis-pack
__output__ Possible matches:
__output__   arm:tools/open-cmsis-pack/cmsis-toolbox-2.0.0
__output__   arm:tools/open-cmsis-pack/cmsis-toolbox-2.0.0-dev3
__output__   arm:tools/open-cmsis-pack/cmsis-toolbox-2.0.0-dev2
__output__   arm:tools/open-cmsis-pack/cmsis-toolbox-2.0.0-dev1
__output__   arm:tools/open-cmsis-pack/cmsis-toolbox-2.0.0-dev0
__output__   arm:tools/open-cmsis-pack/ctools-2.0.0-dev0
__output__   arm:tools/open-cmsis-pack/ctools-1.7.0
__output__   arm:tools/open-cmsis-pack/ctools-1.6.0
__output__   arm:tools/open-cmsis-pack/ctools-1.5.0
```

## List available artifacts

### For example, tools

```
vcpkg-shell find artifact tools
__output__
__output__ warning: vcpkg-artifacts is experimental and may change at any time.
__output__ Artifact                                    Version    Summary
__output__ microsoft:tools/kitware/cmake               <span>3.25</span>.2     Kitwares cmake tool
__output__ microsoft:tools/ninja-build/ninja           <span>1.10</span>.2     Ninja is a small build system with a focus on speed.
__output__ microsoft:tools/arduino/arduino-cli         <span>0.18</span>.3     Arduino IDE
__output__ microsoft:tools/microsoft/openocd           <span>0.12</span>.0     Free and <span>open</span> on-chip debugging
__output__ arm:tools/arm/cmsis-core-tools              <span>5.2</span>.0      Arm CMSIS Core Tools
__output__ arm:tools/open-cmsis-pack/cmsis-toolbox     <span>2.0</span>.0      Arm distributed Open-CMSIS-Pack cli tools
__output__ arm:tools/open-cmsis-pack/ctools            <span>2.0</span>.0-dev0 Arm distributed Open-CMSIS-Pack cli tools
__output__ arm:tools/arm/uv2csolution                  v1.0.0     *.uvprojx/*.uvmpw to csolution/cproject converter
```

### For example, compilers

```
vcpkg-shell find artifact compilers
__output__
__output__ warning: vcpkg-artifacts is experimental and may change at any time.
__output__ Artifact                                                         Version        Summary
__output__ microsoft:compilers/arm-none-eabi-gcc                            <span>10.3</span>.1-2021.10 GCC compiler <span>for</span> ARM CPUs.
__output__ arm:compilers/arm/llvm-embedded                                  <span>16.0</span>.0         LLVM Embedded Toolchain <span>for</span> Arm CPUs.
__output__ arm:compilers/arm/arm-none-eabi-gcc                              <span>12.2</span>.1-mpacbti GCC compiler <span>for</span> ARM CPUs.
__output__ arm:compilers/arm/armclang                                       <span>6.20</span>.0         Arm Compiler <span>for</span> Embedded
```

## Working with the vcpkg-configuration.json file

### Create a new vcpkg-configuration.json file

```
vcpkg-shell new --application
```

### Add artifact to vcpkg-configuration.json file

```
vcpkg-shell add artifact cmake
```

### Remove artifact to vcpkg-configuration.json file

```
vcpkg-shell remove microsoft:tools/kitware/cmake
```

### Update a registry

For example, the `arm` registry:

```
vcpkg-shell x-update-registry arm
```

Before using the Arm Compiler, you need to activate a license. The next step shows how to do that.
