p:cmake

Automate modern CMake configuration and validation for cross-platform builds.

1|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/pontscho/prompt-heaven --skill p-cmake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: p:cmake
Source: https://github.com/pontscho/prompt-heaven/tree/main/ClaudeCode/skills/p%3Acmake
Command: npx skills add https://github.com/pontscho/prompt-heaven --skill p-cmake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modern CMake best practices including cross-platform builds, static linking ( Linux full static, macOS hybrid ), dependency management with pkg-config and find_library, target-based configuration, and platform-specific patterns. Use when writing CMakeLists.txt, configuring builds, linking libraries, or setting up cross-platform C/C++ projects.

Core Features & Use Cases

  • Cross-platform CMake patterns with target-based configuration and explicit find_package/find_library fallbacks.
  • Platform-specific static linking strategies for Linux and macOS, plus guidance on debugging and verification.
  • Dependency management workflows using pkg-config and explicit library discovery to support deterministic builds.

Quick Start

Validate your project with cmake-validator.py CMakeLists.txt to migrate legacy patterns to modern target-based CMake.

Frequently Asked Questions about p:cmake

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

FAQPage Schema
How do I write a modern CMakeLists.txt for cross-platform builds?

Configure cross-platform CMake builds using modern target-based commands instead of directory-level globals. This approach applies properties directly to targets, ensuring portable and deterministic build setups across Linux, macOS, and Windows.

What's the best way to manage dependencies with CMake and pkg-config?

Manage dependencies with pkg-config and explicit find_library fallbacks for deterministic builds. This workflow ensures explicit library discovery, supporting reliable dependency resolution across different platforms.

How do I set up static linking in CMake for Linux and macOS?

Set up static linking in CMake using platform-specific strategies: full static linking on Linux and hybrid static linking on macOS. This approach includes specific guidance on debugging and verifying the linked dependencies.

How do I migrate legacy CMake patterns to target-based configuration?

Migrate legacy CMake patterns to target-based configuration by running a validation tool against your CMakeLists.txt. This identifies outdated global commands and helps apply modern, portable target-based practices.

Does CMake support cross-compilation and explicit library finding?

CMake supports cross-compilation through platform-specific patterns and explicit library finding. Using find_package and find_library fallbacks ensures deterministic dependency discovery when configuring builds for different target platforms.

Why does my CMake build fail to find platform-specific dependencies?

CMake builds fail to find dependencies when relying solely on implicit discovery. Using explicit find_package and find_library fallbacks, alongside pkg-config, ensures deterministic dependency management and successful cross-platform configuration.