# 14 — CMake-facing dependency integration Implementation status: IMPLEMENTED & VERIFIED (2026-11-26). See [STATE](../agent-workflow/STATE.md) and [VERIFICATION](../agent-workflow/VERIFICATION.md) for implemented files and observed checks. ## Requirements and ownership - Requirements: R-009, R-010, R-018. - Delivery phase: Package-manager adoption. - Intended configured role: sol_implementer at XHigh; fresh astra_reviewer acceptance. - Dependencies: 11/12 native package resolution; 13 imported interfaces; 15 package exports. - Proposed exclusive implementation scope: cmake/bridge/, src/package/export-cmake/, tests/cmake-bridge/; root owns bridge/CLI protocol compatibility. Before dispatch, reconcile these paths with the real HEAD, write a full task spec, lint it, and transfer shared-file ownership explicitly. Paths that do not yet exist are NEW. Source-disjoint work still coordinates shared state, ports and build directories. ## Design and interfaces - Ship VbsDeps.cmake as a dependency integration module. Provide new vbs_declare_dependency and vbs_make_available helpers with FetchContent/CPM-style declaration/use separation; do not claim exact macro-level drop-in compatibility. - Allow CMake consumers to use native registry packages and pinned sources without authoring build.cpp. Normalize requests to the same model/lock protocol as native projects. - Resolve/fetch/build only during explicit full dependency operations initiated by the CMake bridge. Generate package-config/imported-target files from typed interfaces, preserving transitive requirements, configuration mappings and runtime artifacts. - Use structured request/result files or argv with correct escaping; avoid shell interpolation. Include requester toolchain/profile/build-target contexts so a host-native package is not substituted into a cross build. - Share verified package blobs while keeping mutable CMake and provider build directories isolated. Define reentry/cycle diagnostics and no global transaction held over a nested child process. - Support locked/offline operation and clear vbs executable/version discovery. Missing vbs is a prerequisite, not permission to download an arbitrary unpinned binary. ## Implementation sequence 1. Freeze helper signatures and versioned native CLI request protocol. 2. Implement model normalization and generation of imported targets/config files. 3. Integrate multi-config/cross-context mapping and package lock ownership. 4. Write consumer examples and test nested dependency/error/cancellation behavior. ## Failure behavior and boundaries - Conflicting declarations identify both CMake origins; no silent first-writer version selection. - Avoid unescaped CMake lists/semicolons, quotes and paths. - No native-build-language requirement added to the consuming CMake project's own targets. - Unsupported interface features fail rather than drop needed transitive flags. ## Acceptance scenarios 1. CMake executable consumes a native package, a CMake source package and a Meson source package. 2. Multiple declarations deduplicate compatible requests and diagnose incompatible ones. 3. Multi-config/debug-release/cross-toolchain mapping and offline/locked repeatability. 4. Paths with spaces, quotes and semicolons; version mismatch and missing vbs diagnostics. 5. Nested package use does not deadlock or overwrite another build's artifacts. ## Verification and integration gate NEW ordinary CMake consumer fixtures configure/build/run against the installed bridge and CLI, separate from building VBS itself. Trace which resolver/provider executes; no production registry needed. Acceptance requires observed results for these scenarios, the affected regression suite, reviewed cross-component contracts, and a fresh independent review. Record unrun checks and environment limitations; tests passing alone do not waive an invariant. No merge, push or deployment is authorized by a review verdict. ## VoidLibrary reuse and upstream candidates Reuse the native package model and exporter; do not implement a second solver in CMake. CMake code remains dependency glue permitted by the user. Shared invariants and input/publication policies are defined in [ARCHITECTURE](ARCHITECTURE.md); requirement authority is [REQUIREMENTS](REQUIREMENTS.md). Return implementation evidence to [VERIFICATION](../agent-workflow/VERIFICATION.md).