Skip to main content

Generate CMakePresets.json configuration and build presets from the cartesian product of a set of parameters.

Project description

Build status Supported Python Versions PyPI Release Version GitHub deployments

TCPM is a CMakePresets.json transformation tool that generates presets for the cartesian product of a set of parameters. For example, given two toolchains :

"toolchain": [
    "gcc",
    "clang"
],

and two different c++ language standards:

"standard": [
    "cpp-20",
    "cpp-23"
],

the tcpm tool will generate four (4) configuration presets:

{
    "name": "configure-gcc-cpp-20"
},
{
    "name": "configure-gcc-cpp-23"
},
{
    "name": "configure-clang-cpp-20"
},
{
    "name": "configure-clang-cpp-23"
},

If you added a third parameter list with two items then TCPM would generate eight (8) configurations, the cartesian product producing \(|A| \times |B| = |A| * |B|\) items.

TCPM also provides a template language to allow generation of various preset fields like "cacheVariables". These templates, called “shapes” in the json, are given contextual tokens to use in string expansion and, for more complex logic, the pQuery DSL embedded in TCPM allows procedural expansion of fields based on the state of a presets document at the time a given preset is generated.

There’s a lot more to it, of course, and TCPM provides a complete JSON transformation language for presets json in in addition to other features. To get started we reccommend starting with the Try Me exercise.

Key Features

  • Matrix Builds – Provides a way to manage large matrices of build types for complex projects that doesn’t require copy-and-paste or a lot of typing 😩

  • Idempotent – The tool will continue to produce the same output given the same parameters as inputs. This allows automated generation of CMakePresets.json files from themselves or using separate template files.

  • Preserves Existing Presets – Any presets that are manually added to a CMakePresets.json file will be maintained when using the “expand-in-place” features of this tool.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tcpm-0.3.1.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tcpm-0.3.1-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file tcpm-0.3.1.tar.gz.

File metadata

  • Download URL: tcpm-0.3.1.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for tcpm-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2d0e289e20136b4929fb114372eed9662d8bfae8973077210a92ba4a7715912c
MD5 ae40bdede4a0eab703849d099efc87e1
BLAKE2b-256 f97c6ccf2643b11041fe92f62f8aa6a2aa85fff760035136d36ca2c7a5d39099

See more details on using hashes here.

Provenance

The following attestation bundles were made for tcpm-0.3.1.tar.gz:

Publisher: CI.yml on thirtytwobits/the-cmake-preset-matrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tcpm-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: tcpm-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for tcpm-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a4d8df33fb4b88d4ac44b2da4093fb77cbaff9e04ecae93c2b81d9f8dfd0cf5
MD5 048de77903d79c864c92589af9b69df3
BLAKE2b-256 04c34f8f7cda9c63852a68bd0b97f1bc9fcb14419077b35462d50d9263c36b51

See more details on using hashes here.

Provenance

The following attestation bundles were made for tcpm-0.3.1-py3-none-any.whl:

Publisher: CI.yml on thirtytwobits/the-cmake-preset-matrix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page