# Vcpkg integration

To help you manage project dependencies and external libraries, CLion integrates with [vcpkg](https://vcpkg.io/en/index.html), a package manager for C/C++.

> **Note:**
> Current limitations:
>
>
>
> * The full set of vcpkg features is available for [CMake](quick-cmake-tutorial.html) projects. For other [project formats](project-models.html), only browsing and installing packages is supported.
>
> * Supported toolchains are all except for [Windows Cygwin](quick-tutorial-on-configuring-clion-on-windows.html#Cygwin), [WSL](how-to-use-wsl-development-environment-in-product.html), [Docker](clion-toolchains-in-docker.html), and [Remote](remote-projects-support.html).
>
>
>
>
>
> See [Known issues](#known-issues) for the corresponding tickets in CLion tracker.

Procedure: Install vcpkg

> **Tip:**
> Vcpkg will be installed on your system. You can have multiple instances of vcpkg installed, each with a different set of packages.
>
>
>
> Also, you can have multiple projects linked to one vcpkg repository.

1. Select `View | Tool Windows | Vcpkg` from the main menu to open the Vcpkg tool window.

2. Click ![](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.add.svg):

![Add vcpkg button in the vcpkg tool window](https://resources.jetbrains.com/help/img/idea/2026.2/cl_add_vcpkg_icon.png)

3. Specify the installation settings in the Add Vcpkg Repository dialog:

![Adding a vcpkg repository](https://resources.jetbrains.com/help/img/idea/2026.2/cl_add_vcpkg_dialog.png)

* The name and URL of your vcpkg repository.

* The installation directory (or use the default value). If you already have vcpkg installed, provide the path to its location in this field.

* Add vcpkg integration to existing CMake profiles > **Note:** > This option is only available for CMake projects. CLion uses CMake toolchain file to integrate with vcpkg. Select the [CMake profiles](cmake-profile.html) you want the toolchain file to be linked to. After the installation, you can find the toolchain file added to the selected profile's CMake options via the `CMAKE_TOOLCHAIN_FILE` variable.

4. Click OK and wait for the installation to complete.

The list of packages will appear in the middle pane. In the right-hand pane, you can find the description and actions for the selected package.

![Vcpkg tool window](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_toolwindow_installsuccess.png)

> **Tip:**
> If vcpkg is not linked to any profile, you will see it greyed out. Use the Edit vcpkg dialog (![](https://resources.jetbrains.com/help/img/idea/2026.2/app.actions.edit_dark.svg)) to link it to a profile.
>
>
>
> ![Vcpkg not linked to any Cmake profile](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_noprofile.png)

Procedure: Browse and install packages

> **Note:**
> The option to select a particular version is not implemented yet ([CPP-32366](https://youtrack.jetbrains.com/issue/CPP-32366/vckpg-Add-ability-to-select-version-of-package)). Only the latest package version can be installed.

1. To find a particular package, start typing its name in the search field:

![Searching for a package](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_search.png)

2. Select the package and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) or click Install in the right-hand pane.

3. In classic mode, if the package was installed successfully, CLion will prompt you to add it to `vcpkg.json` and switch to manifest mode:

![Installation notification](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_install_addtojson_notification.png)

4. You can find the installed package under Installed | Classic Mode or Added | Manifest Mode.

> **Note:**
> Classic mode displays all packages that are in the repository, while [manifest mode](#switch-manifest) displays the packages that are added to `vcpkg.json`.

Classic mode:

![Installed packages subtree](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_installed.png)

Manifest mode:

![Packages added to vcpk.json](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_installed_manifestmode.png)

Procedure: Switch to manifest mode

> **Note:**
> CLion switches to manifest mode automatically if there is a `vcpkg.json` file under the project root.
>
>
>
> Note that classic mode and manifest mode are mutually exclusive.

1. Click the Switch to Manifest Mode button:

![Switch to Manifest Mode](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_switchtomanifest.png)

2. Select the packages to be added to `vcpkg.json`:

![Packages to be added to vcpkg.json](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_switchtomanifest_dialog.png)

3. CLion will create a `vcpkg.json` file, add the packages, and switch the project to manifest mode:

![Switched to manifest mode](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_manifest_switched.png)

Procedure: Investigate console output

Console: vcpkg is a read-only tab that shows all vcpkg commands with full output.

![Vcpkg Console tab](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_consletab.png)

> **Tip:**
> Use the up and down arrows to jump between commands:
>
> ![Jumping between commands in the Console tab](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_console_jump.png)

* When errors occur, for example, during package installation, CLion shows a notification message. Click Show output to open the Console tab and investigate the problem.

![Intallation error message](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_errormessage.png)

* You can switch to the Console tab at any time while working with vcpkg. The tab is also accessible via the Show Console button.

![The Show Console button](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_showconsole.png)

Procedure: Install/remove multiple packages

1. Select several packages in the tree.

2. Use the following shortcuts:

* To install or add to `vcpkg.json`, press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `⏎` (Xcode), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (ReSharper), `⏎` (ReSharper (macOS)), `Enter` (QtCreator), `⏎` (QtCreator (macOS)), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

* To remove, press `Alt+Delete` / `⌘⌫`.

Procedure: Start using a package

Packages should be added to [CMakeLists.txt](cmakelists-txt-file.html). For most packages, vcpkg provides the code to be included in CMake script.

1. If there is a hint from vcpkg, you will see the Add packages to CMakeLists.txt option in the notification:

![Adding packages to CMakeLists.txt](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_add_cmakelists.png)

2. Copy the suggested code into your `CMakeLists.txt` file. If required, change the target link name (which is `main` by default) to the one you want the packages to be linked to.

![Code to paste in CMakeLists.txt](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_add_cmakelists_code.png)

Procedure: Update vcpkg and packages

Use the following tool window actions for update and upgrade:

* Update All updates the vcpkg Git repository to the latest version and then checks it for available package updates.

![Update all icon](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_updateall_icon.png)

* Upgrade All updates the vcpkg Git repository to the latest version and then updates all installed packages to their latest versions.

![Upgrade all icon](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_upgradeall_icon.png)

* Check for Updates (the ![The three dots icon](https://resources.jetbrains.com/help/img/idea/2026.2/toolbox-ide-settings-icon.png) menu) checks whether there is a newer version of the vcpkg Git repository.

* Update Repository (the ![The three dots icon](https://resources.jetbrains.com/help/img/idea/2026.2/toolbox-ide-settings-icon.png) menu) checks the current version of the vcpkg Git repository for available package updates.

* Upgrade Repository (the ![The three dots icon](https://resources.jetbrains.com/help/img/idea/2026.2/toolbox-ide-settings-icon.png) menu) checks the current version of the vcpkg Git repository for available package updates and installs them.

* Update Vcpkg Repository (the ![The three dots icon](https://resources.jetbrains.com/help/img/idea/2026.2/toolbox-ide-settings-icon.png) menu) updates the vcpkg Git repository to the latest version.

Procedure: Upgrade packages one by one

Packages that can be upgraded are indicated by a warning sign.

* Select a package and click the Upgrade package icon in the right-hand pane:

![Upgrading packages one by one](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_updatepackages_onebyone.png)

Procedure: Auto-update repositories

* Click ![](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.general.settings.svg) on the toolbar and select Auto-update repositories on IDE start to allow CLion to check for repository updates on each IDE start.

![Option to auto-update repositories on IDE start](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_autoudate_onrestart.png)

Procedure: Use quick-fixes to add missing packages

* If you include a header from a package that is not yet installed, compilation will fail with the file not found error. Click Fix next to the error message:

![Quick-fix link in the build error message](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_quickfix.png)

CLion will suggest to install the missing package:

![Suggestion to quick-fix for a missing package](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_quickfix_suggestion.png)

* In case there are multiple candidates for installation, open the list from the Fix menu:

![Fix menu](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_quickfix_candidates.png)

Select the package to install in the dialog:

![Package candidates dialog](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_quickfix_candidates_dialog.png)

> **Tip:**
> Fix also works for the profiles not linked to the package manager.

Procedure: Force the use of system CMake and Ninja

You can [force](https://learn.microsoft.com/en-us/vcpkg/users/config-environment#vcpkg_force_system_binaries) vcpkg to use CMake and Ninja from the [profile](cmake-profile.html) environment.

1. Click the Edit vcpkg button in the left-hand pane:

![The Edit vcpkg icon](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_editicon.png)

2. Expand the Advanced Settings section and set the Use system binaries checkbox:

![Force the use of system binaries](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_usesysbins.png)

Procedure: Troubleshooting: vcpkg installs x64-windows triplets instead of MinGW triplets

When you add a package on MinGW, the standard vcpkg installs a x64-windows triplet instead of a [MinGW triplet](https://learn.microsoft.com/en-us/vcpkg/users/platforms/mingw#mingw-native). CLion can fix this automatically.

1. Click Fix in the error message:

![Fix for MinGW triplets](https://resources.jetbrains.com/help/img/idea/2026.2/cl_vcpkg_mingw_fix.png)

2. In classic mode, CLion will add `VCPKG_TARGET_TRIPLET` to CMake options of the current profile.

In manifest mode, CLion will add `VCPKG_TARGET_TRIPLET` to CMake options, along with two environment variables: `VCPKG_DEFAULT_TRIPLET` and `VCPKG_DEFAULT_HOST_TRIPLET`.

## Known issues and limitations

* Currently, vcpkg support is not working for the following toolchains: Cygwin ([CPP-31665](https://youtrack.jetbrains.com/issue/CPP-31665)), Remote ([CPP-30683](https://youtrack.jetbrains.com/issue/CPP-30683)), Docker ([CPP-30684](https://youtrack.jetbrains.com/issue/CPP-30684)), and WSL ([CPP-30685](https://youtrack.jetbrains.com/issue/CPP-30685)).

* Quick-fix for missing packages in the editor is under development ([CPP-31662](https://youtrack.jetbrains.com/issue/CPP-31662)).

## See also

### External Links

[vcpkg's GitHub page](https://github.com/microsoft/vcpkg)

### How tos

[Quick CMake tutorial](quick-cmake-tutorial.html) [CMake profiles](cmake-profile.html) [CLion toolchains](how-to-create-toolchain-in-clion.html)

### Procedures

[Conan plugin](conan-plugin.html)

