tcpm

Usage

Generate CMake presets based on given options. See https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html for details on cmake presets.

This script is driven by configuration in the top-level ‘vendor’ section of the CMakePresets.json file. The ‘tcpm’ section of the ‘vendor’ section is used to generate the presets. The ‘tcpm’ section must contain the following keys:

  • version – The version of the ‘tcpm’ section. The current version is 1.

  • preset-groups – A dictionary of preset groups. Each group must contain the following keys:

    • common – A list of common presets that pre-exist in the presets file and which the group presets should inherit from.

    • parameters – A dictionary of named values to use when generating presets.

See https://thirtytwobits.github.io/the-cmake-preset-matrix for more information.

usage: tcpm [-h] [--version] [--indent INDENT]
            [--presets-version PRESETS_VERSION] [--clean]
            [--no-schema-validation] [--presets-schema-url PRESETS_SCHEMA_URL]
            [--presets-file PRESETS_FILE] [--template-file TEMPLATE_FILE]
            [--force] [--warn-threshold WARN_THRESHOLD] [--verbose]
            [--non-interactive] [--backup-file-suffix BACKUP_FILE_SUFFIX]
            [--no-backup] [--stdout]

Named Arguments

--version

Print the version of the script and exit.

--indent

The number of spaces to indent the output by.

Default: 4

--presets-version

The required version of the presets file.

Default: 7

--clean

Clean the presets file of all presets first.

--no-schema-validation

Skip schema validation.

--presets-schema-url

The URL to the schema to validate against.

Default: 'https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json'

--presets-file, --output-file, -o

The path to the CMakePresets.json file to update.

Default: CMakePresets.json

--template-file, --input-file, -i

A file to use as a template for the presets file. The template file is used to generate the presets file if it does not exist. If the template file and the presets file are the same, the presets file is updated in place using itself as the template. TCPM is designed to be idempotent, so using a presets file as its own template will not change the file unless changes are made that affect preset generation.

Default: CMakePresetsVendorTemplate.json

--force, -f

Force overwrite of the CMakePresets.json file.

--warn-threshold

The number of presets in any given group that will trigger a warning.

Default: 150

--verbose, -v

Print verbose output.

--non-interactive

Do not prompt the user for input.

--backup-file-suffix

The suffix to append to the backup file.

Default: '.bak'

--no-backup, -nb

Do not create a backup when overwriting the presets file.

--stdout, -s

Print the generated presets to standard output instead of writing to a file.

Version: 0.3.2