CMake build system skill for C/C++ projects. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check passedDevelopment

Install Cmake

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill cmake -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills cmake --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/build-systems/cmake .claude/skills/cmake && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cmake
GitHub stars
253
Token cost
~1.7k tokens
SKILL.md length
263 words
Files
2 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

CMake build system skill for C/C++ projects. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 10 steps: Modern CMake principles → Minimal project → Static / shared libraries → …
  • Refactoring CMakeLists.txt
  • SKILL.md covers Purpose, Triggers, Workflow and Related skills
  • Calls cmake; reaches github.com

What it does

Cmake is an agent skill from mohitmishra786/low-level-dev-skills. CMake build system skill for C/C++ projects. Use when writing or refactoring CMakeLists.txt, configuring out-of-source builds, selecting generators (Ninja, Make, VS), managing targets and dependencies with targetlinklibraries, integrating external packages via findpackage or FetchContent, enabling sanitizers, setting up toolchain files for cross-compilation, or exporting CMake packages. Activates on queries about CMakeLists.txt, cmake configure errors, target properties, install rules, CPack, or CMake presets.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/templates.md`).

It sits in Development, covering Refactoring. It works with C++. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Refactoring CMakeLists.txt
  • Configuring out-of-source builds
  • Selecting generators (Ninja
  • Managing targets and dependencies with targetlinklibraries

Example prompts

  • “/cmake”

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Modern CMake principles
  2. Minimal project
  3. Static / shared libraries
  4. Configure and build
  5. External dependencies
  6. Compiler options by configuration
  7. Enable sanitizers
  8. Cross-compilation toolchain file
  9. CMake Presets (CMake 3.20+)
  10. Common errors

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cmake

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cmake loads about 1.7k tokens when it runs, and up to ~2.5k if it reads all its reference files. Until then it costs about 131 tokens; SKILL.md has 263 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~131
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 263 words, ~1,683 tokens.

Download SKILL.mdSave it as .claude/skills/cmake/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
cmake
description
CMake build system skill for C/C++ projects. Use when writing or refactoring CMakeLists.txt, configuring out-of-source builds, selecting generators (Ninja, Make, VS), managing targets and dependencies with target_link_libraries, integrating external packages via find_package or FetchContent, enabling sanitizers, setting up toolchain files for cross-compilation, or exporting CMake packages. Activates on queries about CMakeLists.txt, cmake configure errors, target properties, install rules, CPack, or CMake presets.

CMake

Purpose

Guide agents through modern (target-first) CMake for C/C++ projects: out-of-source builds, dependency management, generator selection, and integration with CI and IDEs.

Triggers

  • "How do I write a CMakeLists.txt for my project?"
  • "How do I add an external library with CMake?"
  • "CMake can't find my package / library"
  • "How do I enable sanitizers in CMake?"
  • "How do I cross-compile with CMake?"
  • "How do I use CMake Presets?"

Workflow

1. Modern CMake principles
  • Define targets, not variables. Use target_* commands.
  • Use PUBLIC/PRIVATE/INTERFACE to control property propagation.
  • Never use include_directories() or link_libraries() (legacy).
  • Minimum CMake version: cmake_minimum_required(VERSION 3.20) for most features.
2. Minimal project
cmake
cmake_minimum_required(VERSION 3.20)
project(MyApp VERSION 1.0 LANGUAGES C CXX)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(myapp
    src/main.c
    src/utils.c
)

target_include_directories(myapp PRIVATE include)
target_compile_options(myapp PRIVATE -Wall -Wextra)
3. Static / shared libraries
cmake
# Static library
add_library(mylib STATIC lib/foo.c lib/bar.c)
target_include_directories(mylib
    PUBLIC  include      # consumers get this include path
    PRIVATE src          # only mylib itself sees this
)

# Shared library
add_library(myshared SHARED lib/foo.c)
set_target_properties(myshared PROPERTIES
    VERSION   1.0.0
    SOVERSION 1
)

# Link executable against library
add_executable(myapp src/main.c)
target_link_libraries(myapp PRIVATE mylib)
4. Configure and build
bash
# Out-of-source build (always do this)
cmake -S . -B build
cmake --build build

# With generator
cmake -S . -B build -G Ninja
cmake --build build -- -j$(nproc)

# Debug build
cmake -S . -B build-debug -DCMAKE_BUILD_TYPE=Debug
cmake --build build-debug

# Release
cmake -S . -B build-release -DCMAKE_BUILD_TYPE=Release
cmake --build build-release

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

Build types: Debug, Release, RelWithDebInfo, MinSizeRel.

5. External dependencies
find_package (system-installed libraries)
cmake
find_package(OpenSSL REQUIRED)
target_link_libraries(myapp PRIVATE OpenSSL::SSL OpenSSL::Crypto)

find_package(Threads REQUIRED)
target_link_libraries(myapp PRIVATE Threads::Threads)

find_package(ZLIB REQUIRED)
target_link_libraries(myapp PRIVATE ZLIB::ZLIB)
FetchContent (download and build dependency)
cmake
include(FetchContent)

FetchContent_Declare(
    googletest
    GIT_REPOSITORY https://github.com/google/googletest.git
    GIT_TAG        v1.14.0
)
FetchContent_MakeAvailable(googletest)

add_executable(mytest test/test_foo.cpp)
target_link_libraries(mytest PRIVATE GTest::gtest_main mylib)
pkg-config fallback
cmake
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBFOO REQUIRED libfoo>=1.2)
target_link_libraries(myapp PRIVATE ${LIBFOO_LIBRARIES})
target_include_directories(myapp PRIVATE ${LIBFOO_INCLUDE_DIRS})
6. Compiler options by configuration
cmake
target_compile_options(myapp PRIVATE
    $<$<CONFIG:Debug>:-g -Og -fsanitize=address>
    $<$<CONFIG:Release>:-O2 -DNDEBUG>
    $<$<CXX_COMPILER_ID:GNU>:-fanalyzer>
    $<$<CXX_COMPILER_ID:Clang>:-Weverything>
)

target_link_options(myapp PRIVATE
    $<$<CONFIG:Debug>:-fsanitize=address>
)

Generator expressions: $<condition:value> evaluated at build time.

7. Enable sanitizers
cmake
option(ENABLE_ASAN "Enable AddressSanitizer" OFF)

if(ENABLE_ASAN)
    target_compile_options(myapp PRIVATE -fsanitize=address -fno-omit-frame-pointer -g -O1)
    target_link_options(myapp PRIVATE -fsanitize=address)
endif()

Build: cmake -DENABLE_ASAN=ON -S . -B build-asan && cmake --build build-asan

8. Cross-compilation toolchain file
cmake
# toolchain-aarch64.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER   aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_SYSROOT /opt/aarch64-sysroot)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
bash
cmake -S . -B build-arm -DCMAKE_TOOLCHAIN_FILE=toolchain-aarch64.cmake
9. CMake Presets (CMake 3.20+)
json
{
  "version": 6,
  "configurePresets": [
    {
      "name": "release",
      "displayName": "Release",
      "generator": "Ninja",
      "binaryDir": "${sourceDir}/build/release",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Release",
        "CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
      }
    },
    {
      "name": "debug",
      "displayName": "Debug",
      "generator": "Ninja",
      "binaryDir": "${sourceDir}/build/debug",
      "cacheVariables": {
        "CMAKE_BUILD_TYPE": "Debug",
        "ENABLE_ASAN": "ON"
      }
    }
  ],
  "buildPresets": [
    { "name": "release", "configurePreset": "release" },
    { "name": "debug",   "configurePreset": "debug" }
  ]
}
bash
cmake --preset release
cmake --build --preset release
10. Common errors
ErrorCauseFix
Could not find package FooPackage not installed or wrong prefixInstall dev package; set CMAKE_PREFIX_PATH
No CMAKE_CXX_COMPILERNo C++ compiler foundInstall g++/clang++; check PATH
target_link_libraries called with wrong number of argumentsMissing PUBLIC/PRIVATE/INTERFACEAdd the keyword
Cannot find source fileTypo or wrong relative pathCheck path relative to CMakeLists.txt
generator expression errorWrong $<> syntaxCheck CMake docs for expression name

For a complete CMakeLists.txt template, see references/templates.md.

  • Use skills/build-systems/ninja for Ninja generator details
  • Use skills/build-systems/make for Make generator
  • Use skills/compilers/cross-gcc for cross-compilation toolchain setup
  • Use skills/runtimes/sanitizers for sanitizer integration details

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/build-systems/cmake of mohitmishra786/low-level-dev-skills.

  • SKILL.md
  • references/templates.md

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Cmake next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cmake compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cmake this skillmohitmishra786/low-level-dev-skills253—~1.7kAutomated safety check: PassMIT
Embedded Cpp14 MisraBlueAndi/Pixelix443—~2kAutomated safety check: PassMIT
Ss Cpp ModernSerial-Studio/Serial-Studio7.2k—~1.6kAutomated safety check: PassCustom licence
Cpp ProYikai-Liao/symusic1891 repos~1.1kAutomated safety check: PassMIT
Readable Cppcrazyguitar/cppcheatsheet290—~6.4kAutomated safety check: PassMIT
Cpp Codingtimeplus-io/proton2.3k—~582Automated safety check: PassApache-2.0

Similar skills

  • Embedded Cpp14 Misra

    BlueAndi/Pixelix

    A skill your agent uses when writing, reviewing, or refactoring C/C++ firmware code in this repository (src/, lib/, test/) — creating or editing .h/.hpp/.cpp files, applying MISRA-oriented and…

    443 GitHub stars~2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ss Cpp Modern

    Serial-Studio/Serial-Studio

    Modern C++20 authoring guidance for Serial Studio (Qt 6.11, C++20): concepts, ranges, move/RAII, std smart pointers, constexpr, lock-free SPSC atomics.

    7.2k GitHub stars~1.6k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Cpp Pro

    Yikai-Liao/symusic

    Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques.

    189 GitHub starsUsed in 1 repo~1.1k tokens
    DevelopmentAuto-check passed
  • Readable Cpp

    crazyguitar/cppcheatsheet

    Readable C/C++/Rust/CUDA code rules inspired by The Art of Readable Code.

    290 GitHub stars~6.4k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Cpp Coding

    timeplus-io/proton

    Write or review Timeplus/Proton C++20 code covering naming conventions, Proton fences, clang-format, IProcessor patterns, and checkpointing.

    2.3k GitHub stars~582 tokensUpdated 19 days ago
    DevelopmentAuto-check passed
  • Qt Qml

    Serial-Studio/Serial-Studio

    QML authoring best practices for Serial Studio (Qt 6.11). An agent skill from Serial-Studio/Serial-Studio.

    7.2k GitHub stars~2.9k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Cmake

What does Cmake do?

CMake build system skill for C/C++ projects. An agent skill from mohitmishra786/low-level-dev-skills. Cmake is an agent skill from mohitmishra786/low-level-dev-skills. CMake build system skill for C/C++ projects.

When should I use Cmake?

Cmake fits situations like: refactoring CMakeLists.txt; configuring out-of-source builds; selecting generators (Ninja; managing targets and dependencies with targetlinklibraries.

How do I install Cmake in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill cmake -a claude-code`. Or copy the skill folder (skills/build-systems/cmake in mohitmishra786/low-level-dev-skills) into .claude/skills/cmake in your project. Claude Code loads it when a task matches its description.

How do I install Cmake in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill cmake -a codex`. Or copy the skill folder (skills/build-systems/cmake in mohitmishra786/low-level-dev-skills) into .agents/skills/cmake in your project. Codex loads it when a task matches its description.

Can I use Cmake in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill cmake -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cmake, .gemini/skills/cmake, .github/skills/cmake and .opencode/skills/cmake in your project.

What does Cmake need to run?

Going by SKILL.md and its folder, Cmake needs the command-line tools its instructions call (cmake).

Does Cmake access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Cmake safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cmake use?

Cmake is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cmake use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 866 tokens, read only when the agent opens those files.

What are the alternatives to Cmake?

Skills that share tags, products or a category with Cmake: Embedded Cpp14 Misra (BlueAndi/Pixelix, 443 stars), Ss Cpp Modern (Serial-Studio/Serial-Studio, 7.2k stars), Cpp Pro (Yikai-Liao/symusic, 189 stars) and Readable Cpp (crazyguitar/cppcheatsheet, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cmake?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.