This repo contains a PowerShell Module for running CMake builds that use CMake Presets. CMake Presets provide a declaration - through a JSON file - of the available builds, where their binary directories should be, and all sorts of useful metadata that makes it easier to build standard tooling around the build. This PowerShell module is one attempt at such tooling.
The PSCMake PowerShell module supports:
- configuring and building a CMake build,
- generating a 'DGML'- or 'DOT'- file for a build,
- invoking executable CMake build outputs.
By leveraging the CMake file API, the module is able to offer tab-completion for presets, configurations and targets, and can implicitly scope the build based on the current working directory.
To install the module, use PowerShell's Import-Module
CmdLet:
> Import-Module PSCMake
Note: The module uses unapproved PowerShell verbs, preferring CMake verbs. As a result, the Import-Module will report warnings when importing the module.
The module provides the following commands:
Configure-CMakeBuild
- To run CMake configuration for a given presetBuild-CMakeBuild
- To run a CMake build.Write-CMakeBuild
- To output the CMake build as a DOT or DGML graph.Invoke-CMakeOutput
- To run an executable output from a CMake build, by target name or implicitly by scope.
Running Build-CMakeBuild
by itself would run the first buildConfiguration
. Run any command with -?
to get more
details.