Alison Aquinas logoAlison's LLM Plugins

cmake

Included in pluginci-cdView on GitHub ↗

Files

SKILL.mdagentsreferences

Install

Install the containing plugin
/plugin install ci-cd@llm-skills
Invoke this skill after installation
/ci-cd:cmake
Download cmake-skill.zip
This skill is bundled inside ci-cd. Install the plugin once, then Claude Code can use any of its included skills. Browse the full plugin repository at github.com/alisonaquinas/llm-ci-dev.

SKILL.md


name: cmake description: Configure and build C/C++ projects with CMake. Use when tasks mention cmake commands, CMakeLists.txt, build configuration, generators, or cross-platform C/C++ builds.

CMake

Intent Router

RequestReferenceLoad When
Install tool, first-time setupreferences/install-and-setup.mdInstall or verify CMake
CMakeLists.txt, targets, find_packagereferences/cmakelists.mdWrite or debug CMakeLists.txt
CLI commands, configure, build, testreferences/command-cookbook.mdRun cmake or ctest commands
Build types, generators, presetsreferences/build-types-and-generators.mdSelect build type or generator

Quick Start

# Configure (out-of-source — ALWAYS use -B, never cmake . in source root)
cmake -S . -B build

# Build
cmake --build build

# Run tests
ctest --test-dir build

# Install
cmake --install build --prefix /usr/local

Core Command Tracks

  • Configure: cmake -S . -B build — generates build system in build/
  • Set build type: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
  • Build: cmake --build build — invokes the underlying build tool
  • Specific target: cmake --build build --target <target>
  • Test: ctest --test-dir build — runs registered tests
  • Install: cmake --install build --prefix /usr/local
  • Use preset: cmake --preset <name> — reads from CMakePresets.json
  • List cache: cmake -L build — show all cache variables

Safety Guardrails

  • Always build out-of-source using -B build — never run cmake . in the source root as it contaminates the source tree with generated files.
  • Clean a build by deleting the build/ directory; running cmake --build build --clean-first rebuilds without reconfiguring.
  • Use --dry-run with install to preview what gets installed before committing.
  • Commit CMakePresets.json for reproducible configurations, but add build/ to .gitignore.
  • Pin cmake_minimum_required(VERSION X.Y) to avoid behavior changes across CMake versions.
# Troubleshoot a broken build: clean and reconfigure with verbose output
rm -rf build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build --verbose 2>&1 | tail -20

Related Skills

  • make — GNU Make, often the underlying build tool used by CMake's Unix Makefiles generator
  • ci-architecture — integrating CMake builds into CI/CD pipelines

References

← Back to marketplace