Provides official patterns for integrating and managing C++ libraries via vcpkg in imodel-native.
Install
mkdir -p .claude/skills/vcpkg && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17818" && unzip -o skill.zip -d .claude/skills/vcpkg && rm skill.zipInstalls to .claude/skills/vcpkg
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Authoritative guide for vcpkg library integration in imodel-native. USE FOR adding a new vcpkg-managed library, migrating an existing library to vcpkg, or updating a vcpkg-managed library version. Covers the sequential install chain, PartFile wiring, mke patterns, triplet selection, and version pinnKey capabilities
- →Add a new vcpkg-managed library to imodel-native.
- →Migrate an existing library to vcpkg management.
- →Update a vcpkg-managed library version.
- →Create manifest and configuration files for new libraries.
- →Wire consumer PartFile dependencies for vcpkg libraries.
How it works
This skill guides the process of integrating vcpkg libraries by defining a sequential install chain and specifying the necessary manifest, configuration, and build files. It ensures proper dependency management and build integrity.
Inputs & outputs
When to use vcpkg
- →Adding a new dependency
- →Updating a vcpkg library
- →Migrating existing libs to vcpkg
About this skill
vcpkg Integration in imodel-native
All vcpkg documentation for humans lives in iModelCore/libsrc/VCPKG.md.
This skill summarises the patterns an agent needs to get the build wiring right.
The Sequential Install Chain
All vcpkg install calls run through a single sequential chain defined in
iModelCore/libsrc/vcpkg.PartFile.xml. The chain currently is:
vcpkg (bootstrap)
└─► vcpkg_install_compress
└─► vcpkg_install_png
└─► vcpkg_install_openssl
└─► vcpkg_install_crashpad
Each link is a separate Part with its own vcpkg_install_<consumer>.mke that calls
vcpkg_run_install.bat / vcpkg_run_install.sh. Chaining ensures no two vcpkg
processes ever run concurrently — concurrent runs against the same install root collide
on vcpkg-running.lock and corrupt the build.
Consumer .mke files do NOT call vcpkg_run_install themselves. By the time a
consumer .mke runs, its install is already complete.
Adding a New vcpkg Library
Always update
iModelCore/libsrc/README.md— add a row to the library table with the directory, library name, version, andYesin the vcpkg column.
1. Create the manifest directory
Under iModelCore/libsrc/<mylib>/:
vcpkg.json— list dependency withversion>=underdependenciesand exact version underoverridesvcpkg-configuration.json— copy from an existing consumer (e.g.compress/); updatebaselineif neededtriplets/— platform-specific triplet files if the defaults iniModelCore/libsrc/are not sufficient (seecompress/triplets/for examples)
2. Create iModelCore/libsrc/vcpkg_install_<mylib>.mke
%include mdl.mki
mylibDir = $(_MakeFilePath)<mylib>/
installRoot = $(OutputRootDir)vcpkg_installed/<mylib>/
# Add vcpkgWindowsMDCRT = 1 here if the library must link /MD on Windows (like openssl).
# Add vcpkgUseVeracodeTriplet = 1 here ONLY if this library's base triplet sets explicit
# -RTC flags and you have provided a triplets/x64-windows-static-veracode.cmake overlay
# that omits them (see compress/ and crashpad/). Libraries whose triplets set no -RTC
# flags need no veracode variant and should leave this undefined.
%include $(_MakeFilePath)vcpkg.mki
always:
%if defined (winNT)
$(_MakeFilePath)vcpkg_run_install.bat $(mylibDir) $(installRoot) $(vcpkgTriplet)
%else
$(_MakeFilePath)vcpkg_run_install.sh $(mylibDir) $(installRoot) $(vcpkgTriplet)
%endif
$(_MakeFilePath) resolves to libsrc/ because the file lives there, so the paths to
<mylib>/, vcpkg_run_install.bat/sh, and vcpkg.mki are all correct.
3. Extend the chain in iModelCore/libsrc/vcpkg.PartFile.xml
Insert a new link into the chain. Appending at the end is the simplest choice, but the chain only needs to stay linear — where a link sits does not affect correctness because every consumer depends on its own named part. Prefer placing a more basic/foundational library (e.g. a compression or image codec that other libraries build on) earlier in the chain, and insert a new link wherever it reads most naturally alongside its peers.
To append at the end (after the current last link):
<Part Name="vcpkg_install_<mylib>" BentleyBuildMakeFile="vcpkg_install_<mylib>.mke">
<SubPart PartName="vcpkg_install_<current-last>" LibType="Static"/>
</Part>
To insert mid-chain, point the new part at its predecessor and re-parent the following
link onto the new part, keeping the chain linear. Whichever position you choose, update
the sibling .mke comment ("Runs after vcpkg_install_<prev>…") on every link whose
predecessor changed.
4. Wire the consumer PartFile
In your library's .PartFile.xml, depend on the chain part with LibType="Static".
Critical: $(OutputRootDir) differs between static and dynamic builds (static/vcpkg_installed/…
vs vcpkg_installed/…). The chain always runs static-only; dynamic builds do not run
vcpkg install at all — their .mke reads the packages the static chain produced under
static/vcpkg_installed/… (see step 5).
Using LibType="Static" here ensures the static chain completes (and populates that install
root) before a dynamic build starts, without triggering a redundant dynamic chain build that
would race against the static one on the shared vcpkg git repo.
<Part Name="MyLib" BentleyBuildMakeFile="MyLib.mke">
<!-- LibType="Static": chain is static-only. Dynamic builds read the packages from the
static install root; they do not run vcpkg themselves (see step 5). -->
<SubPart PartName="vcpkg_install_<mylib>" PartFile="iModelCore/libsrc/vcpkg" LibType="Static"/>
...
If a separate prewire/PublicAPI part also needs the install, give it the same
LibType="Static" SubPart (see BeOpenSSL.PartFile.xml for the __PublicAPI example).
5. Write the consumer .mke
Include vcpkg.mki to get vcpkgTriplet, then set vcpkgInstallRoot.
Key rule: the chain always runs as Static, so the installed packages always live under
the static OutputRootDir. Dynamic builds must redirect vcpkgInstallRoot to that
same static location — do not call vcpkg_run_install from the dynamic .mke path,
because this creates a concurrent vcpkg process that races against the static chain on
shared global locks (registry git lock, cmake download rename, etc.).
Use CREATE_STATIC_LIBRARIES (defined by bmake for static builds) to pick the right root:
# Static builds: packages are at $(OutputRootDir)vcpkg_installed/<mylib>/
# Dynamic builds: chain ran as Static; redirect to the same location.
%if defined (CREATE_STATIC_LIBRARIES)
vcpkgInstallRoot = $(OutputRootDir)vcpkg_installed/<mylib>/
%else
vcpkgInstallRoot = $(OutputRootDir)static/vcpkg_installed/<mylib>/
%endif
vcpkgTripletDir = $(vcpkgInstallRoot)$(vcpkgTriplet)/
vcpkgIncludeDir = $(vcpkgTripletDir)include/
vcpkgLibDir = $(vcpkgTripletDir)lib/
No vcpkg_run_install call in the .mke at all — the chain part handles it.
Libraries that only build as static (e.g. compress, crashpad client) can skip the
%if defined (CREATE_STATIC_LIBRARIES) conditional and use $(OutputRootDir)vcpkg_installed/…
directly — their OutputRootDir is always the static one.
6. Migrating an existing (previously vendored) library
When the library you are moving to vcpkg was previously vendored (its source checked into
iModelCore/libsrc/<mylib>/), the vendored source deletion belongs in the same PR as the
vcpkg wiring, but do not delete it up front. Keep the vendored source in place (the PR will
likely be draft/WIP at this stage) until after the PR has passed its Copilot review, then
remove the vendored code in a separate standalone commit within that same PR. Deleting the
vendored source up front produces too many modified files for Copilot to review, and the review
may not run at all.
Updating an Existing Library Version
Always update
iModelCore/libsrc/README.md— bump the version in the library table to match the new version invcpkg.json.
- Edit
iModelCore/libsrc/<consumer>/vcpkg.json:- Update the
version>=value underdependencies - Update the matching entry in
overrides
- Update the
- If the new version requires a newer port registry, update
baselineiniModelCore/libsrc/<consumer>/vcpkg-configuration.json. - No changes to
.mkeor.PartFile.xmlfiles are needed — the next build will pick up the new version via the binary cache or a fresh build.
Triplet Selection (vcpkg.mki)
iModelCore/libsrc/vcpkg.mki maps TARGET_PROCESSOR_ARCHITECTURE to vcpkgTriplet:
| Architecture | Triplet | Notes |
|---|---|---|
x64 | x64-windows-static | Default Windows; set vcpkgWindowsMDCRT=1 before %include for -md variant |
x64 + vcpkgWindowsMDCRT=1 | x64-windows-static-md | OpenSSL and other /MD libs on Windows |
MacOSARM64 | arm64-osx | |
LinuxX64 | x64-linux | |
AndroidARM64 | arm64-android | |
AndroidX64 | x64-android | |
iOSARM64 | arm64-ios |
Key Files
| File | Purpose |
|---|---|
iModelCore/libsrc/vcpkg.PartFile.xml | Sequential chain — edit to add new install parts |
iModelCore/libsrc/vcpkg_install_*.mke | One file per consumer; calls vcpkg_run_install |
iModelCore/libsrc/vcpkg.mki | Triplet selection; include from any install or consumer mke |
iModelCore/libsrc/vcpkg_run_install.bat / .sh | Wrapper that invokes the vcpkg executable |
iModelCore/libsrc/VCPKG.md | Human-facing documentation; keep in sync when changing patterns |
When not to use it
- →When the library is not vcpkg-managed.
- →When the task is not related to imodel-native vcpkg integration.
Limitations
- →All `vcpkg install` calls run through a single sequential chain.
- →Concurrent runs against the same install root collide on `vcpkg-running.lock`.
- →Dynamic builds do not run `vcpkg install` at all.
How it compares
This skill provides a structured, step-by-step process for vcpkg integration specific to imodel-native, ensuring adherence to established patterns and preventing common build conflicts, unlike general vcpkg usage.
Compared to similar skills
vcpkg side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| vcpkg (this skill) | 0 | 17d | No flags | Advanced |
| arm-cortex-expert | 29 | 3mo | No flags | Advanced |
| game-engine-resources | 14 | 3mo | No flags | Advanced |
| pc-games | 5 | 6mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
arm-cortex-expert
sickn33
Senior embedded software engineer specializing in firmware and driver development for ARM Cortex-M microcontrollers (Teensy, STM32, nRF52, SAMD). Decades of experience writing reliable, optimized, and maintainable embedded code with deep expertise in memory barriers, DMA/cache coherency, interrupt-driven I/O, and peripheral drivers.
game-engine-resources
gmh5225
Guide for game engine development resources including engine source code, plugins, and development guides. Use this skill when researching game engines (Unreal, Unity, Godot, custom engines), engine architecture, or game development frameworks.
pc-games
davila7
PC and console game development principles. Engine selection, platform features, optimization strategies.
mlir-development
gmh5225
Expertise in MLIR (Multi-Level Intermediate Representation) and CIR (Clang IR) development for domain-specific compilation and high-level optimizations. Use this skill when building ML compilers, domain-specific languages, or working with multi-level compilation pipelines.
port-c-module
RediSearch
Guide for porting a C module to Rust
compiler-development
gmh5225
Expertise in compiler development using LLVM infrastructure including frontend design, IR generation, optimization passes, and code generation. Use this skill when building custom programming languages, implementing DSL compilers, or working on compiler internals.