cmake-vcpkg

Configure C++ projects with vcpkg manifest mode and CMakePresets.json.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/pingqLIN/skill-0 --skill cmake-vcpkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cmake-vcpkg
Source: https://github.com/pingqLIN/skill-0/tree/main/converted-skills/cmake-vcpkg
Command: npx skills add https://github.com/pingqLIN/skill-0 --skill cmake-vcpkg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill assists in managing C++ project dependencies using vcpkg in manifest mode, ensuring cross-platform and cross-compiler compatibility.

Core Features & Use Cases

  • vcpkg Manifest Mode: Provides guidance tailored for projects using vcpkg's manifest mode.
  • Cross-Platform Support: Offers suggestions compatible with MSVC, Clang, and GCC compilers.
  • CMake Integration: Recommends using CMakePresets.json for configuration.
  • File Path Handling: Ensures correct absolute file paths are used in examples, especially for libraries like OpenCV.

Quick Start

Provide guidance on configuring a C++ project using CMake and vcpkg in manifest mode, ensuring cross-platform compatibility.

Frequently Asked Questions about cmake-vcpkg

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage C++ dependencies with vcpkg in manifest mode?

To manage C++ dependencies with vcpkg in manifest mode, configure your project using a vcpkg.json manifest file and integrate it with CMake. This approach ensures dependencies are declared explicitly and resolved automatically during the build configuration process.

Does vcpkg manifest mode support cross-platform C++ compilation?

Yes, vcpkg manifest mode supports cross-platform C++ compilation across MSVC, Clang, and GCC compilers. It provides configuration guidance to ensure your project builds consistently regardless of the target operating system or compiler toolchain.

What is the best way to configure CMake with vcpkg for cross-compiler compatibility?

The best way to configure CMake with vcpkg for cross-compiler compatibility is by using CMakePresets.json. This file standardizes build configurations, allowing you to define toolchain paths and compiler options consistently for MSVC, Clang, and GCC.

How do I handle absolute file paths for libraries like OpenCV when using vcpkg?

When using vcpkg with libraries like OpenCV, ensure you use correct absolute file paths for file system operations in your CMake configuration. This prevents path resolution errors during the build process and ensures proper library linking.

Why should I use CMakePresets.json instead of manual CMake arguments for vcpkg?

Using CMakePresets.json instead of manual CMake arguments standardizes your vcpkg integration by defining toolchain variables and build settings in a single file. This ensures reproducible builds across different environments and simplifies cross-platform configuration.

Can I use vcpkg manifest mode without modifying my existing CMakeLists.txt?

Yes, you can use vcpkg manifest mode without heavily modifying your existing CMakeLists.txt by defining the vcpkg toolchain path in CMakePresets.json. This externalizes dependency management configuration while keeping your core build script clean.