The `cmakelang` project provides Quality Assurance (QA) and other language tools for CMake. It includes command-line tools like `cmake-annotate` for generating HTML, `cmake-format` for source code formatting, `cmake-lint` for checking common issues, and `ctest-to` for parsing CTest output. The project, currently at version 0.6.13, is actively maintained with a regular release cadence. While the PyPI package is now `cmakelang`, the GitHub repository is still named `cmake_format`.
pip install cmakelangVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `cmake-format` to automatically reformat a CMakeLists.txt file. It creates a sample file, formats it in-place, and then prints the before and after content. This highlights the primary command-line interface of the `cmakelang` tools.
Update your installation commands from `pip install cmake-format` to `pip install cmakelang`. Existing `cmake-format` installs will pull in `cmakelang` as a dependency, but direct usage of `cmakelang` is recommended.
Review your configuration files and consider updating them to the new structure. You can generate a default configuration in your preferred format using `cmake-format --dump-config [yaml|json|python]` as a starting point.
Install with feature flags (e.g., `pip install cmakelang[YAML]` or `pip install cmakelang[html-gen]`) or manually install the required Python packages (`pip install pyyaml` / `pip install jinja2`).
Add detailed specifications for your custom commands to your `cmakelang` configuration file (e.g., in `additional_commands` section) to guide the formatter and linter.
If `cmake-format --dump-config` fails, try executing it from a clean directory (e.g., `/` or `/tmp`) to ensure no corrupt local configuration files interfere.
Be aware that external references (e.g., `git clone` URLs) might still use `cmake_format`, and these may change if the repository is officially renamed.