setting up vcpkg on windows

Article Info
Last Updated
(c522687)
Tip
You don’t need to worry about doing this on Lab machines, it should already be setup for you.

Download vcpkg

The download for vcpkg is available as a zip file from the github page. Download and extract this and save it into a suitable place (on lab machines, the D drive is a good place for it).

unzip

Run the bootstrap script

The full executable is not included in the zip file. It is generated when the bootstrap script is exectuted. Run the vcpkg-bootstrap script in the root of the project you just unzipped.

vcpkg bootstrap

Edit your enviroment variables

There are two environment variables you should edit to make the script work. The first is used to tell your prompt where to find the executable, this is the path variable. The second is one we will add to let cmake know that you have vcpkg installed and it can use it for finding dependencies.

Enviroment variable editor

You can find open the start menu on windows, and search for env, select 'Edit environment variables for your account' from the list of options.

env

Adding the new environment variable

press the New button under the 'user variables' section.

env new env

Set the name of your new environment variable to be, VCPKG_ROOT and the value to be the location you extracted vcpkg to (in my case, d:\vcpkg\vcpkg-2023.01.09, this should be where you found vcpkg-bootstrap earlier.

press OK to confirm your choice.

Altering 'path'

Next, we’ll alter 'path' to contain the same folder. This will let us use vcpkg from the command line.

env select path

Select the 'path' variable and select Edit.

env edit path

Select New on the 'edit environment variable' window that pops up, you can also use the 'Browse…​' button to find the path. The path should then be listed, as shown in the screenshot.

Graduation Cap Book Open book GitHub Info chevron-right Sticky Note chevron-left Puzzle Piece Lightbulb Video Exclamation Triangle Globe