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:
- Select Help > About Plugins > Utilities > Vcpkg to enable the plugin.
- 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:
- Select File > New File > Vcpkg.
- In Name, enter a name for the manifest file.
- In Version, enter a version number for the file.
- In Dependencies, enter the packages to manage.
You can add packages later in a manifest editor.
- Select Next to open the Project Management page.
- 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:
- Place the cursor on the line where you want to add a package.
- Select the
(Search Package) button.
- Select the package to add to your project.
- Select OK to return to the editor.
- Repeat to add more packages.
To set the path to the directory where you installed vcpkg, select (Configure) on the editor toolbar.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.