The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

CMake plugin

cmake: Run cmake with arbitrary arguments

Runs the tool and returns the exit code of the process.
  • installation : String
  • arguments : String (optional)
  • ignoredExitCodes : String (optional)
  • label : String (optional)
    Allows to display a more meaningful text in the console output, the pipeline step view and the blue ocean details for this step, like with stages.
    If non-empty, the specified text will be displayed instead of the default step type description.
  • workingDir : String (optional)

cmakeBuild: Generate build-scripts with cmake and execute them

Uses CMake to generate build-scripts and can run these.
This invokes cmake with the given options to generate the build scripts.
Any non-zero exit code during build-script generation causes Jenkins to mark the build as a failure.

To run the generated build script, you have to add build tool invocation steps.

For example, to run the equivalent of the sh shell script

   mkdir build && cd build
   cmake -G Ninja <workpace-root>/source
   DESTDIR=<workpace-root>/artifacts ninja all install
  
you would enter the following pipeline script:

  cmakeBuild
      generator: 'Ninja',
      buildDir: 'build',
      sourceDir: 'source',
      installation: 'InSearchPath',
      steps: [
          [args: 'all install', envVars: 'DESTDIR=${WORKSPACE}/artifacts']
      ]
  
  • installation : String
  • buildDir : String (optional)
  • buildType : String (optional)
  • cleanBuild : boolean (optional)
  • cmakeArgs : String (optional)
  • generator : String (optional)
  • label : String (optional)
    Allows to display a more meaningful text in the console output, the pipeline step view and the blue ocean details for this step, like with stages.
    If non-empty, the specified text will be displayed instead of the default step type description.
  • preloadScript : String (optional)
  • sourceDir : String (optional)
  • steps (optional)
      Array / List of Nested Object
    • args : String (optional)
      Specify arguments to pass to the build tool or to cmake. Arguments must be separated by spaces but may contain spaces if they are enclosed in double quotes (will be handled like a Unix shell does),
      Most of the time, you will want to leave this empty (to call the default build target) or you will specify just some build target names here.
    • envVars : String (optional)
      Specify extra environment variables to pass to the build tool as key-value pairs here.
      Each entry must be on its own line, for example:
      DESTDIR=${WORKSPACE}/artifacts/dir
      KEY=VALUE
    • withCmake : boolean (optional)
      Whether to run the actual build tool directly (by expanding $CMAKE_BUILD_TOOL) or to have cmake run the build tool (by invoking cmake --build <dir>).
      • Leave unchecked for minimal performance overhead.
      • Make it checked, if you selected one of the Visual Studio or Xcode generators above AND if you run CMake v. 2.8.11 or newer.

cpack: Run cpack

Runs the tool and returns the exit code of the process.
  • installation : String
  • arguments : String (optional)
  • ignoredExitCodes : String (optional)
  • label : String (optional)
    Allows to display a more meaningful text in the console output, the pipeline step view and the blue ocean details for this step, like with stages.
    If non-empty, the specified text will be displayed instead of the default step type description.
  • workingDir : String (optional)

ctest: Run ctest

Runs the tool and returns the exit code of the process.
  • installation : String
  • arguments : String (optional)
  • ignoredExitCodes : String (optional)
  • label : String (optional)
    Allows to display a more meaningful text in the console output, the pipeline step view and the blue ocean details for this step, like with stages.
    If non-empty, the specified text will be displayed instead of the default step type description.
  • workingDir : String (optional)

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.