Workflow CMake - BredaUniversityGames/JenkinsLib GitHub Wiki

cmake.workflow()

Runs a full CMake workflow preset (configure + build + test + package in one step).

Usage

stages {
    git.sync()
    cmake.workflow()
    // ...
}

Parameters

Parameter Default Description
CMAKE_WORKFLOW_PRESET (first preset) Workflow preset (dropdown populated from CMakePresets.json)

Note: Requires workflowPresets in your CMakePresets.json. The module is skipped with a warning if none are found.

How It Works

  1. Discovers workflow presets from CMakePresets.json (see cmake.build() — Preset Discovery)
  2. Sets up the Visual Studio environment via vcvarsall.bat
  3. Runs cmake --workflow --preset <preset>
  4. Sets ctx.buildEngine = 'CMake' on the pipeline context

When to Use

Workflow presets are useful when your CMakePresets.json defines a complete pipeline (configure, build, test, package) as a single workflow. This is simpler than chaining cmake.build() + cmake.test() + cmake.package() separately, but offers less flexibility for customizing individual steps.

Troubleshooting

Issue Solution
"requires workflow presets" warning Ensure your CMakePresets.json contains non-hidden workflowPresets
No workflow preset dropdown Run the job once so the library discovers your CMakePresets.json, then re-run
⚠️ **GitHub.com Fallback** ⚠️