Modern target-first CMake guidance for C/C++ builds, from project setup through cross-compilation and presets.
- CCM score
- 62 of 100
- skills.sh installs
- 1.9K
- GitHub stars
- 303
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers out-of-source configure and build, generator selection (Ninja, Make, VS), target linking with PUBLIC/PRIVATE/INTERFACE, and install rules
- Includes dependency patterns for
find_package,FetchContent, andpkg-configfallback, plus sanitizer toggles and cross-compile toolchain files - Enforces target-first conventions by steering away from legacy
include_directories()andlink_libraries()commands - Designed for agents writing or refactoring
CMakeLists.txt, debugging configure errors, or setting up CMake Presets
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill cmake -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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/INTERFACEto control property propagation. - Never use
include_directories()orlink_libraries()(legacy). - Minimum CMake version:
cmake_minimum_required(VERSION 3.20)for most features.
2. Minimal project
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)
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Category
- CLI & Terminal
- First seen
- May 16, 2026
More from mohitmishra786/low-level-dev-skills
All 54Similar to Cmake
More CLI & TerminalmesonSkillmohitmishra786/low-level-dev-skills654 installsMeson setup, wrap dependencies, options, and cross-compilation for C/C++ projects, plus CMake migration guidance.
ninjaSkillmohitmishra786/low-level-dev-skills742 installsNinja build executor skill covering CMake generation, parallelism tuning, diagnostics, and build.ninja internals.
gccSkillzhinkgit/embeddedskills733 installsCmake-based GCC embedded build skill that scans projects, configures, builds, rebuilds, cleans, and analyzes ELF size.
makefile-generatorSkillakin-ozer/cc-devops-skills697 installsCreate, generate, or scaffold Makefiles with .PHONY targets and standard build automation.
modern-cppPlugintrailofbits/skills8.4K starsModern C++ best practices (C++20/23/26). Use when writing C++ code, creating new C++ projects, or modernizing legacy C++ patterns.
cpp-proSkilljeffallan/claude-skills5.9K installsModern C++20/23 developer skill for concepts, ranges, coroutines, SIMD, and CMake-based performance work.