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
-
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-libs — ITK_USE_SYSTEM_LIBRARIES=ON
itk-doxygen — documentation build
-
Document the preset workflow in Documentation/AI/building.md
-
Ship a CMakeUserPresets.json.example as a starting point
-
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.
Standardize ITK build configurations via tracked
CMakePresets.jsonwith common presets (development, wrapping, system-libraries, doxygen) that developers can inherit from in their localCMakeUserPresets.json.Motivation and discussion
From discussion on PR #6040:
@blowekamp (comment):
@hjmjohnson (reply):
Proposed scope
Create a tracked
CMakePresets.jsonwith hidden base presets:itk-base— shared settings (Ninja, export compile commands)itk-development— full build with testingitk-wrapping— Python wrapping enableditk-system-libs—ITK_USE_SYSTEM_LIBRARIES=ONitk-doxygen— documentation buildDocument the preset workflow in
Documentation/AI/building.mdShip a
CMakeUserPresets.json.exampleas a starting pointAddress AI agent instruction customization — blowekamp uses
.github-instructions.mdfor Copilot; ITK usesAGENTS.mdandDocumentation/AI/for Claude Code. Consider whether a unified convention is needed.