--- id: gersemi version: "0.28.0" license: MPL-2.0 license_treatment: copyleft maintenance: active --- # gersemi — A formatter to make your CMake code the real treasure License: copyleft · Maintenance: active · Downloads: 141.3K/mo ## What it is and what it does gersemi is a standalone CMake code formatter that reads CMake source files and rewrites them according to configurable style rules. It operates as a command-line tool that can check, diff, or in-place reformat CMakeLists.txt files and .cmake modules, with support for parallel processing across multiple files. The formatter respects configuration files (.gersemirc) placed in project directories and allows fine-grained control over line length, indentation style, list expansion behavior, and custom command definitions. The tool is designed for developers and build system maintainers who want to enforce consistent CMake code style across projects. It integrates into CI/CD pipelines for formatting checks, supports stdin/stdout workflows, and includes caching to speed up repeated runs on unchanged files. Configuration can be stored in version-controlled .gersemirc files or supplied via command-line arguments, making it suitable for team environments. Use it for: - Enforce consistent CMake formatting across a multi-module C/C++ project as part of CI/CD. - Reformat legacy CMakeLists.txt files to a modern style before refactoring. - Check if CMake code meets team style guidelines in pre-commit hooks. - Integrate CMake formatting into an IDE or editor workflow via stdin/stdout. - Configure project-specific formatting rules in .gersemirc and share across team members. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. gersemi is a command-line formatter for CMake code that automatically reformats CMakeLists.txt and .cmake files to a consistent style, with support for custom command definitions and configurable formatting rules. Yes. gersemi is actively maintained, has no known vulnerabilities, and solves a real problem for CMake-based projects. The medium install friction is acceptable given the pre-built wheels and lightweight dependency. The copyleft license (MPL-2.0) does not restrict your use of the tool itself. Install it if you maintain CMake code and want automated, configurable formatting. ## Install pip install gersemi uv add gersemi poetry add gersemi ## Installing gersemi Before you install: Medium install friction due to pre-built wheels for multiple Python versions and architectures, but the single runtime dependency (pyyaml) is lightweight. Maintenance is active with a recent release 24 days ago and consistent commit activity. License in practice: gersemi is licensed under MPL-2.0 (copyleft). You must disclose source code modifications and distribute under the same license if you modify and redistribute the package, though using it as a tool does not impose restrictions on your CMake projects. Quickstart: pip install gersemi # Format a CMake file in-place gersemi -i CMakeLists.txt # Check if files need formatting gersemi -c src/ Requires Python 3.8 or later. pyyaml must be installed (handled automatically by pip). Verify before relying: - Whether the formatter handles all CMake syntax variants and edge cases reliably in production use. - Performance characteristics when formatting large CMake projects with many files. - Compatibility with custom CMake extensions and third-party module ecosystems. ## Package facts - License: MPL-2.0 (copyleft) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 141.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cmake code formatter, cmake style formatter, cmake linter, cmake beautifier, cmake code formatting tool, cmake syntax formatter, cmake file formatter, cmake, code-formatter, build-tools [View on SkillFed](https://skillfed.io/packages/gersemi) · [View on PyPI](https://pypi.org/project/gersemi/)