Skip to content

ENH: Adopt CMakePresets.json for standardized ITK build configurations #6050

@hjmjohnson

Description

@hjmjohnson

Standardize ITK build configurations via tracked CMakePresets.json with common presets (development, wrapping, system-libraries, doxygen) that developers can inherit from in their local CMakeUserPresets.json.

Motivation and discussion

From discussion on PR #6040:

@blowekamp (comment):

I have been using CMakeUserPresets.json to hold predefined configuration of ITK such as "development", "wrapping", "system-libraries", or "doxygen". I have found these CMakePreset.json files very useful to manage different configurations, perhaps they could be more widely adopted? Not sure how user customization of these instructions should occur.

@hjmjohnson (reply):

CMakePresets[User].json would be widely useful. I've had some success with it, and I think it would be a way to codify, in an AI-friendly JSON format, more meaning than can be achieved with mixes of shell command-line options.

Proposed scope
  1. Create a tracked CMakePresets.json with hidden base presets:

    • itk-base — shared settings (Ninja, export compile commands)
    • itk-development — full build with testing
    • itk-wrapping — Python wrapping enabled
    • itk-system-libsITK_USE_SYSTEM_LIBRARIES=ON
    • itk-doxygen — documentation build
  2. Document the preset workflow in Documentation/AI/building.md

  3. Ship a CMakeUserPresets.json.example as a starting point

  4. Address AI agent instruction customization — blowekamp uses .github-instructions.md for Copilot; ITK uses AGENTS.md and Documentation/AI/ for Claude Code. Consider whether a unified convention is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions