cpp-modern-cmake

Review and generate modern target-based CMake for embedded C and C++ build systems.

1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/Binh230199/ai --skill cpp-modern-cmake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-modern-cmake
Source: https://github.com/Binh230199/ai/tree/main/.github/skills/cpp-modern-cmake
Command: npx skills add https://github.com/Binh230199/ai --skill cpp-modern-cmake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write, review, and debug modern CMake build systems for embedded C and C++ projects without falling back to brittle global flags or legacy patterns.

Core Features & Use Cases

  • Target-based CMake: Define clean library and executable targets with proper PUBLIC, PRIVATE, and INTERFACE scoping.
  • Cross-compilation setup: Configure toolchain files, sysroots, and presets for Android NDK, Linux BSP, and QNX targets.
  • Build lifecycle support: Add tests, install rules, packaging, sanitizers, clang-tidy, and CI-friendly CMakePresets for reproducible workflows.
  • Use Case: A developer can modernize an automotive IVI module by replacing ad hoc include paths and link flags with maintainable target-based CMake and preset-driven builds.

Quick Start

Ask the Skill to review your CMakeLists.txt or preset files for modern target-scoped structure, cross-compilation readiness, and install-rule correctness.

Frequently Asked Questions about cpp-modern-cmake

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

FAQPage Schema
How do I configure CMake cross-compilation for Android NDK and QNX targets?

Configure CMake cross-compilation by defining toolchain files and sysroots to target Android NDK, Linux BSP, and QNX platforms. This Skill generates toolchain setups that properly bind compiler paths and sysroot locations for embedded C and C++ builds.

How do I modernize legacy CMakeLists.txt with target-based CMake?

Modernize legacy CMakeLists.txt by replacing global flags with target-based CMake using proper PUBLIC, PRIVATE, and INTERFACE scoping. This Skill reviews your build scripts and generates maintainable target-scoped dependencies and compile features without brittle global patterns.

Does this CMake Skill support adding sanitizers and clang-tidy to embedded build systems?

Yes, this Skill supports adding sanitizers and clang-tidy to embedded build systems. It integrates these tools alongside testing and packaging rules to validate reproducible builds for automotive Linux and Android NDK projects.

What is the best way to set up CMake install rules and packaging for embedded C++ projects?

The best way to set up CMake install rules is by defining target-scoped install commands that package libraries and executables correctly. This Skill reviews and generates install rules to ensure proper artifact deployment for embedded C and C++ build systems.

How do I avoid global CMake flags when setting up an automotive Linux build?

Avoid global CMake flags by defining target-scoped dependencies and compile features instead of modifying global variables. This Skill helps you refactor automotive Linux builds by enforcing modern target-based CMake patterns over legacy global configurations.