Skip to main content
Alison Aquinas logoAlison's LLM Skills Marketplace

cmake

Included in skill bundleci-cdView on GitHub ↗

Files

SKILL.mdagentsreferences

Install

Install only this skill with npx skills
npx skills add alisonaquinas/llm-ci-dev --skill 'cmake' -g -y
Install the containing skill bundle
/plugin install ci-cd@llm-skills
Download cmake-skill.zip
This skill is bundled inside ci-cd. Use npx skills when you only want this skill, or install the bundle once to make every included skill available through the plugin marketplace flow. Browse the full skill bundle repository at github.com/alisonaquinas/llm-ci-dev.

Invoke

Invoke this skill after installation
/ci-cd:cmake

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