build-cmake

Explain common CMake configuration problems and best practices for C++ build systems.

5|2|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/AxGord/claude-workflow --skill build-cmake-axgord
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-cmake
Source: https://github.com/AxGord/claude-workflow/tree/main/templates/skills/build-cmake
Command: npx skills add https://github.com/AxGord/claude-workflow --skill build-cmake-axgord

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill unit helps developers understand and navigate common issues within the CMake build system, enhancing efficiency and reducing errors in the development process.

Core Features & Use Cases

  • Identify Search Order Issues: Clarifies the correct usage of find_package to avoid missing files.
  • Handle CMP0077 Issues: Explains and mitigates the effects of the CMake Policy CMP0077 when dealing with normal variables and option() directives.
  • CMake and apt Version Mismatch: Suggests a fallback approach for using a newer version of a package like Catch2 in environments where the system version does not match the requirement.
  • FetchContent Alternatives: Shows alternative methods to handle dependencies in Docker without requiring git.
  • Use Case: When integrating CMake with a C++ project, use this Skill to ensure that the build system is correctly configured and to understand the implications of CMake version and policy settings.

Quick Start

Run 'cmake-guide' to get insights on CMake build system best practices.

Frequently Asked Questions about build-cmake

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

FAQPage Schema
How do I fix CMake find_package search order issues causing missing files?

To fix CMake find_package search order issues causing missing files, you must clarify the correct usage of the directive to ensure the build system checks the expected paths and resolves dependencies properly.

What is CMake policy CMP0077 and how does it affect option directives?

CMake policy CMP0077 affects how normal variables interact with option directives. Understanding this policy helps mitigate unexpected configuration behaviors when setting variables before calling option().

How do I handle CMake and apt version mismatches for C++ dependencies like Catch2?

To handle CMake and apt version mismatches for dependencies like Catch2, implement a fallback approach that overrides the system version with a newer package version required by your build process.

What are FetchContent alternatives for managing CMake dependencies in Docker without git?

FetchContent alternatives for managing CMake dependencies in Docker without git include using alternative methods to download and configure packages, ensuring builds work in restricted environments lacking version control tools.

Can I use CMake for package versioning and policy management in C++ projects?

Yes, you can use CMake for package versioning and policy management in C++ projects. It helps configure build systems correctly, managing dependency versions and applying necessary policy settings.