InsightSoftwareConsortium / InsightSoftwareConsortium/ITK
ENH: Adopt CMakePresets.json for standardized ITK build configurations
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 748
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 64
Description
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](https://github.com/InsightSoftwareConsortium/ITK/pull/6040#issuecomment-4238332184)):
> 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](https://github.com/InsightSoftwareConsortium/ITK/pull/6040#issuecomment-4239393593)):
> 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-libs` — `ITK_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.
Contributor guide
Assessment
This issue has not been assessed yet.