Vcpkg VSCode CMake extension provides vcpkg integration in VSCode.
Please report any bugs in github.
- VSCode >= 1.76.0
- CMake Tools extension >= 1.13.0
You can use Vcpkg getting start page to control vcpkg behavior.
for more options, please see Preferences - Settings - Extensions - vcpkg.
Also, you can manually control vcpkg behavior with the following commands:
- Ctrl(⌘) + Shift + P
- Search vcpkg.
- Select
vcpkg: Enable vcpkg:
a. Extension will automaticly enable vcpkg if you already set environment variable VCPKG_ROOT or already set vcpkg path in settings.
b. Extension will automaticly enable vcpkg if vcpkg root folder was selected before.
c. Otherwise, please choose vcpkg root folder.
- Extension will select the triplet (dynamic) according to your system architecture, vcpkg toolchain will be added into cmake settings.
You can also enable/disable vcpkg in Preferences - Settings - Extensions(in workspace) - Vcpkg.
Note: please only enable/disable in workspace!
- Ctrl(⌘) + Shift + P
- Search vcpkg.
- Select
vcpkg: Disable vcpkg. - vcpkg toolchain will be removed from cmake toolchain and other vcpkg setting will also be removed from cmake options.
- Ctrl(⌘) + Shift + P
- Search vcpkg.
- Select
vcpkg: Use static library.
- Ctrl(⌘) + Shift + P
- Search vcpkg.
- Select
vcpkg: Use dynamic library.
- Ctrl(⌘) + Shift + P
- Search vcpkg.
- Select
vcpkg: Set target triplet. - Enter your target triplet
- Ctrl(⌘) + Shift + P
- Search vcpkg.
- Select
vcpkg: Set host triplet. - Enter your host triplet
- Open
Preferences-Settings-Extensions(inworkspace) -Vcpkg. - Select/Unselect
Vcpkg › General: Auto Update Triplet.
- Open
Preferences-Settings-Extensions(inworkspace) -Vcpkg. - Add additional options one by one in
Vcpkg › Target: Additional Options.
- Open
Preferences-Settings-Extensions(inworkspace) -Vcpkg. - Select/Unselect
Vcpkg › Target: Install Dependencies.
- Open
Preferences-Settings-Extensions(inworkspace) -Vcpkg. - Select/Unselect
Vcpkg › Target: Prefer System Libs.
- Enable vcpkg integration.
- Set vcpkg path.
- Autocompletion will be enabled automatically when typing
".
- Set breakpoint in the portfile.cmake (required) or other cmake file.
- Open
Run and Debugin left side bar, selectDebug portfile(s), click the green triangle to run debugging.
- Set breakpoint in the portfile.cmake.
- Run install command with
--editable(important!) then set breakpoint in source cmake file(folder name without.clean). - Open
Run and Debugin left side bar, selectDebug portfile(s), click the green triangle to run debugging.
