- Qt Creator Manual
- Advanced Use
- Build Systems
- Managing Packages with vcpkg
- Qt Creator Manual 11.0.0

Setting Up Conan ◦ Using Command Line Options

# Managing Packages with vcpkg

The experimental vcpkg plugin integrates the vcpkg C/C++ package manager into Qt Creator. It's available on all the supported development platforms.

You can use Qt Creator to create and edit vcpkg.json files to specify packages to build as part of your project when using CMake as the build system.

## Enabling the vcpkg Plugin

To enable the vcpkg plugin:

1. Select Help > About Plugins > Utilities > Vcpkg to enable the plugin.
2. Select Restart Now to restart Qt Creator and load the plugin.

## Setting vcpkg Preferences

By default, vcpkg is automatically set up for use with CMake. To disable automatic setup, select Edit > Preferences > CMake > General > Package manager auto setup.

To set the Path to the directory where you installed vcpkg, select Edit > Preferences > CMake > Vcpkg.

Select to download vcpkg if you have not installed it yet.

## Creating vcpkg Manifest Files

To create a new vcpkg package manager manifest (vcpkg.json) file:

1. Select File > New File > Vcpkg.

2. In Name, enter a name for the manifest file.
3. In Version, enter a version number for the file.
4. In Dependencies, enter the packages to manage.

   You can add packages later in a manifest editor.

5. Select Next to open the Project Management page.
6. Select Finish to create the file.

The wizard automatically adds the vcpkg.json file to the CMakeLists.txt file of the project.

## Selecting Packages to Manage

When you open a vcpkg.json file, it opens in the manifest file editor:

To add a package to your project:

1. Place the cursor on the line where you want to add a package.
2. Select the (Search Package) button.

3. Select the package to add to your project.
4. Select OK to return to the editor.
5. Repeat to add more packages.

To set the path to the directory where you installed vcpkg, select (Configure) on the editor toolbar.

Setting Up Conan ◦ Using Command Line Options