build-cmake

build-cmake is a skill for Claude Code from AxGord/claude-workflow. It costs 10 tokens per session (1,089 once invoked), scanned A, original, MIT.

A reference guide to common CMake build-system mistakes. It explains how package lookup paths and subproject options affect a build.

In plain words
What is it for?
Use it when writing or debugging CMake files, especially package discovery, dependency paths, and options for vendored subprojects.
Why use it?
It helps prevent builds from finding the wrong package configuration or ignoring settings passed to included projects.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the workflow plugin — 28 skills, 2 hooks, 1 MCP server shipped together

Good fit Use it when writing or debugging CMake files, especially package discovery, dependency paths, and options for vendored subprojects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/axgord/claude-workflow/build-cmake
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AxGord/claude-workflow --skill build-cmake
Clone the repo
git clone --depth 1 https://github.com/AxGord/claude-workflow

Made for: Claude Code.

Or install workflow, the plugin that ships this one along with the rest of its 28 skills, 2 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-cmake

README.md
[![agentmods](https://agentmods.dev/badge/skills/axgord/claude-workflow/build-cmake/github.svg)](https://agentmods.dev/skills/axgord/claude-workflow/build-cmake)
Your own site
<a href="https://agentmods.dev/skills/axgord/claude-workflow/build-cmake"><img src="https://agentmods.dev/badge/skills/axgord/claude-workflow/build-cmake/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for build-cmake

Your own site · 80×15
<a href="https://agentmods.dev/skills/axgord/claude-workflow/build-cmake"><img src="https://agentmods.dev/badge/skills/axgord/claude-workflow/build-cmake.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,089 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00010 $0.01089
Opus 5 $0.00005 $0.00544
Sonnet 5 $0.00002 $0.00218
Haiku 4.5 $0.00001 $0.00109

Measured 9d ago against content hash 3dff0116e956, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

build-cmake scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/skills/build-cmake/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CMake — Verified Gotchas

find_package Search Order

No mode specified = tries MODULE first, then CONFIG (commonly reversed!):

  • First looks for FindFoo.cmake in CMAKE_MODULE_PATH (MODULE)
  • Then falls back to FooConfig.cmake (CONFIG)
  • find_package(Foo) might find wrong file — always specify CONFIG or MODULE explicitly
# CONFIG: CMAKE_PREFIX_PATH entries are PREFIXES — CMake searches
# <prefix>/lib/cmake/Foo/, <prefix>/share/cmake/Foo/, etc.
# for FooConfig.cmake or foo-config.cmake (not the prefix dir itself)
set(CMAKE_PREFIX_PATH "/opt/mylib")

# CONFIG: Foo_DIR points at the EXACT dir containing FooConfig.cmake
set(Foo_DIR "/opt/mylib/lib/cmake/Foo")

# MODULE: CMAKE_MODULE_PATH dirs are searched DIRECTLY for FindFoo.cmake — NOT the same!
set(CMAKE_MODULE_PATH "/opt/cmake-modules")

CMP0077: Normal Variables Override Options (add_subdirectory)

# Parent project configures a vendored subproject:
set(FOO_ENABLE_TESTS OFF)   # normal variable — must be set BEFORE the option() executes
add_subdirectory(foo)       # foo's CMakeLists.txt contains: option(FOO_ENABLE_TESTS "..." ON)
  • CMP0077 OLD: option() discards the pre-set normal variable and creates the cache entry → the parent's OFF is lost.
  • CMP0077 NEW: option() becomes a no-op when a normal variable of that name exists → the parent's OFF wins.

The policy is controlled by the subproject: cmake_minimum_required(VERSION 3.13...) there, or cmake_policy(SET CMP0077 NEW) before its option() calls. The parent can force it for all subprojects with set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) before add_subdirectory.

Key: this is about normal variables overriding option() cache entries — not cache-to-cache override.

Ubuntu apt catch2 = v2, NOT v3

apt install catch2 on Ubuntu 22.04 (and earlier) installs Catch2 v2.x. find_package(Catch2 3 REQUIRED) will fail. Use FetchContent fallback:

find_package(Catch2 3 QUIET)
if(NOT Catch2_FOUND)
    include(FetchContent)
    FetchContent_Declare(Catch2
        GIT_REPOSITORY https://github.com/catchorg/Catch2.git
        GIT_TAG        v3.5.2
        GIT_SHALLOW    TRUE
    )
    FetchContent_MakeAvailable(Catch2)
    list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
endif()

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 84 lines · 10 tokens per session scan A 3dff0116e956

Subscribe to this mod's changes

build-cmake is a skill published in the GitHub repository AxGord/claude-workflow (5 stars, last pushed 1mo ago), licensed MIT. It adds 10 tokens to every session and 1,089 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens