cmake

Automates CMake project setup and build configuration for C/C++.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/rdromer2/mambavision_tf_kernel --skill cmake
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cmake
Source: https://github.com/rdromer2/mambavision_tf_kernel/tree/main/.agents/skills/cmake
Command: npx skills add https://github.com/rdromer2/mambavision_tf_kernel --skill cmake

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

CMake is the de facto build system for C/C++ projects; this skill guides users through modern, target-centric workflows, making it easier to configure out-of-source builds, choose generators, manage targets and dependencies, and integrate external packages via FetchContent or find_package.

Core Features & Use Cases

  • Emphasizes modern CMake principles: define targets, use PUBLIC/PRIVATE/INTERFACE scopes, and avoid legacy include_directories or link_libraries.
  • Supports common workflows: out-of-source builds, multiple generators (Ninja, Make, VS), dependency management, sanitizers, and cross-compilation toolchains.
  • Provides templates and references for common patterns: FetchContent, Presets, and cross-platform configurations, enabling quick onboarding and consistency across projects.

Quick Start

Create an out-of-source build for a sample project using Ninja and verify a minimal target-based configuration compiles successfully.

Frequently Asked Questions about cmake

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a modern CMake build configuration for a C/C++ project?▼

Set up a modern CMake build by defining targets and using PUBLIC/PRIVATE/INTERFACE scopes. This target-centric approach replaces legacy include_directories, ensuring proper dependency propagation and out-of-source build isolation for C/C++ projects.

What is the best way to manage external dependencies in CMake?▼

Manage external dependencies in CMake using find_package for installed system libraries or FetchContent to download and configure source code automatically. FetchContent integrates external packages directly during the build generation step.

How do I configure cross-compilation toolchains in CMake?▼

Configure cross-compilation in CMake by specifying a toolchain file that defines target platform variables and compilers. This ensures the build system generates correct makefiles or project files for the target architecture.

Can I use CMake Presets to define multiple build configurations?▼

Yes, CMake Presets allow you to define multiple build configurations in a CMakePresets.json file. You can specify different generators, binary directories, and toolchain files, streamlining out-of-source builds across environments.

Does this CMake skill support Ninja and Visual Studio generators?▼

Yes, the skill supports generator selection including Ninja, Make, and Visual Studio. It guides you through choosing the appropriate generator for your target platform and build environment during configuration.

Why should I avoid legacy CMake commands like link_libraries?▼

Avoid legacy commands like link_libraries because they apply globally, causing hidden dependencies and scope pollution. Modern CMake enforces target-centric usage with target_link_libraries to ensure clean, predictable dependency management.