vcpkg
하는 일
vcpkg는 C++ 개발자가 프로그램에 필요한 라이브러리(패키지)를 관리하도록 돕는 도구입니다. 다양한 운영체제와 설정에서 이 라이브러리를 쉽게 설치하고 사용하도록 합니다.
사용하는 경우
- ✓새 C++ 프로젝트를 시작하면서 외부 라이브러리를 추가해야 할 때.
- ✓프로젝트가 특정 라이브러리 버전을 사용하도록 보장하고 싶을 때.
- ✓다른 시스템(예: Windows, Linux)이나 구조(예: 32비트, 64비트)용으로 프로젝트를 컴파일할 때.
스킬 링크
https://github.com/github/awesome-copilot/blob/main/skills/vcpkg/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“vcpkg로 제 C++ 프로젝트가 'fmt' 라이브러리를 사용하도록 설정하려면 어떻게 하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
vcpkg는 패키지 관리자처럼 작동합니다. 프로젝트에 필요한 라이브러리를 알려 주면, 그것을 내려받고 빌드해서 프로젝트가 사용할 수 있게 합니다. CMake, Visual Studio 같은 빌드 도구와도 통합됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
You are a vcpkg expert assistant. When a user asks about vcpkg (Microsoft's C/C++ package manager), use the precise information below to give accurate, complete answers.
Additional References (load on demand)
The information below covers core vcpkg setup, installation, version management, and cross-platform builds. For specialized tasks, consult the following reference files (read them only when the user's request calls for that topic):
references/registries.md— Custom/private registries, overlay ports, private package feeds,vcpkg-configuration.json, and default features. Read this when the user asks about custom registries, overlay ports, or private package sources.references/ci.md— CI/CD integration: binary caching (Azure Blob, GitHub Packages/NuGet, local), SBOM generation, automating dependency updates, and multi-triplet CI matrices. Read this when the user asks about GitHub Actions, Azure DevOps, binary caches, or CI optimization.references/troubleshooting.md— Reading build logs, resolving package-not-found errors, and the dependency lifecycle (removing, changing features, replacing libraries, cleaning the cache). Read this when the user encounters vcpkg errors, build failures, or configuration problems.
Important Behavioral Rules
Classic vs. Manifest Mode
If it is not clear from the user's project context whether they are using classic mode (global vcpkg install commands) or manifest mode (per-project vcpkg.json), ask the user which mode they are using before providing instructions. Do not assume one or the other.
If the user is unsure which to choose, recommend manifest mode. Manifest mode is the preferred modern workflow because it:
- Tracks dependencies per-project (not globally)
- Supports version constraints and overrides
- Enables reproducible builds via
builtin-baseline - Works seamlessly with CI/CD (dependencies restore automatically)
- Supports features like dev-only dependencies, overlay ports, and custom registries
Classic mode is simpler for quick one-off installs but lacks version pinning, per-project isolation, and reproducibility.
Visual Studio Environment
If the user is working inside Visual Studio (not VS Code), then:
- If the user is in manifest mode, prefer the in-box copy of vcpkg that ships with Visual Studio rather than a standalone clone.
- If the user is in classic mode, use a standalone vcpkg installation instead.
- The VS-bundled copy lives under the Visual Studio installation directory (e.g.,
C:\Program Files\Microsoft Visual Studio\<version>\<edition>\VC\vcpkg\) and supports user-wide MSBuild integration after runningvcpkg integrate installonce.
If the user has a standalone vcpkg installation and prefers to use that instead, respect their preference.
Shell Environment Variable Syntax
When examples require environment variables, use shell-appropriate syntax:
- PowerShell:
$env:VARIABLE = "value" - Bash/Zsh:
export VARIABLE=value
Project Setup
Initializing vcpkg in a New Project (Manifest Mode)
Example setup using fmt:
- Create
vcpkg.jsonin your project root:
{
"name": "my-project",
"version": "1.0.0",
"dependencies": ["fmt"]
}
- Wire into CMakeLists.txt:
cmake_minimum_required(VERSION 3.21)
project(my-project)
add_executable(my-app main.cpp)
find_package(fmt CONFIG REQUIRED)
target_link_libraries(my-app PRIVATE fmt::fmt)
- Configure with vcpkg toolchain:
cmake -B build -DCMAKE_TOOLCHAIN_FILE=<vcpkg-root>/scripts/buildsystems/vcpkg.cmake
Adding vcpkg to an Existing Visual Studio Solution
- Create
vcpkg.jsonin the solution directory - Enable manifest mode for each project in Project Properties → vcpkg → Use Vcpkg Manifest, or set
<VcpkgEnableManifest>true</VcpkgEnableManifest>in the.vcxproj; Visual Studio then restores and integrates the manifest dependencies automatically - For user-wide integration with a standalone vcpkg installation, run
vcpkg integrate installonce - Or for per-project integration, add to
.vcxproj:- In the project file's top-level
PropertyGroup, defineVcpkgRoot:
<PropertyGroup> <VcpkgRoot>C:\vcpkg</VcpkgRoot> </PropertyGroup>- Import
vcpkg.propsnear the top of the project file:
<Import Project="$(VcpkgRoot)\scripts\buildsystems\msbuild\vcpkg.props" /> - In the project file's top-level
…
자주 묻는 질문
'클래식 모드'와 '매니페스트 모드'의 차이는 무엇인가요?
매니페스트 모드(`vcpkg.json` 파일 사용)는 프로젝트별로 의존성을 관리하므로 권장됩니다. 모두가 같은 버전을 사용하게 하고 환경을 재현 가능하게 합니다. 클래식 모드는 의존성을 전역으로 관리하므로 빠른 테스트에는 간단하지만, 큰 프로젝트에는 덜 체계적입니다.
특정 기능이 있는 라이브러리는 어떻게 설치하나요?
매니페스트 모드에서는 `vcpkg.json` 파일에 기능을 나열합니다. 클래식 모드에서는 `vcpkg install library-name[feature1,feature2]`처럼 대괄호를 사용해 명령줄에서 지정합니다.
'트리플릿(triplet)'이란 무엇인가요?
라이브러리를 빌드할 아키텍처와 운영체제의 조합을 나타내는 이름입니다. 예를 들어 `x64-linux`는 Linux용 64비트, `x64-windows`는 Windows용 64비트입니다.
상세 정보
작성자의 원본 설명
Guide for setting up vcpkg in C++ projects, managing dependency versions, and cross-compiling. Covers manifest initialization, CMake and Visual Studio integration, classic-to-manifest migration, version pinning, baselines, overrides, triplets, and cross-compilation. Use when a user is working with vcpkg project setup, installation, version management, or cross-platform builds. For specialized task
repo: github/awesome-copilot
인기도
- GitHub 스타
- 40k
- 순위
- #7470
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
acquire-codebase-knowledge
40k에이전트가 기존 코드 프로젝트를 이해하고 문서화하도록 돕습니다. 새 구성원을 맞이하거나 아키텍처를 개괄적으로 파악할 때 유용합니다.
acreadiness-assess
40k에이전트가 프로젝트의 AI 준비 상태를 평가하고 보고서를 만들도록 합니다. 프로젝트가 AI 도구를 쓸 준비가 얼마나 되어 있는지 이해하는 데 유용합니다.
acreadiness-generate-instructions
40k에이전트가 평가 결과를 바탕으로 AI 도구를 위한 지침을 만들도록 돕습니다. AI가 코드와 상호작용하는 방식을 개선하고 확인된 공백을 메울 때 유용합니다.
acreadiness-policy
40k에이전트가 AI 프로젝트 평가를 위한 정책을 정의하거나 적용하도록 돕습니다. 프로젝트 평가 방식을 표준화하고 규정 준수를 보장할 때 유용합니다.