Build: CMake

VSTS | TFS 2018 | TFS 2017 | TFS 2015

Build with the CMake cross-platform build system

Demands

cmake

Arguments

Argument Description
Working Directory

Working directory when CMake is run. The default value is build.

If you specify a relative path, then it is relative to your repo. For example, if you specify build, the result is the same as if you specified $(Build.SourcesDirectory)\build.

You can also specify a full path outside the repo, and you can use variables. For example: $(Build.ArtifactStagingDirectory)\build

If the path you specify does not exist, CMAke creates it.

Arguments Arguments that you want to pass to CMake.
Control options

Q&A

How do I enable CMake for hosted agents?

The hosted agents have CMake installed, but you must manually add the capability to use the CMake build step.

  1. Open the Agent Pools control panel tab:

    • VSTS: https://{your_account}.visualstudio.com/_admin/_AgentPool
    • TFS 2017 and newer: https://{your_server}/tfs/DefaultCollection/_admin/_AgentPool
    • TFS 2015: http://{your_server}:8080/tfs/_admin/_AgentPool

    The TFS URL doesn't work for me. How can I get the correct URL?

  2. In the left column, click the name of the hosted pool that you are using. In the right column click Capabilities.
  3. Click Add capability and set the fields to cmake and yes.
  4. Click Save changes

How do I enable CMake for my on-premises agent?

  1. Deploy an agent.
  2. Install CMake and make sure to add it to the path of the user that the agent is running as on your agent machine.
  3. In your web browser, navigate to the Agent pools control panel tab:

    • VSTS: https://{your_account}.visualstudio.com/_admin/_AgentPool
    • TFS 2017 and newer: https://{your_server}/tfs/DefaultCollection/_admin/_AgentPool
    • TFS 2015: http://{your_server}:8080/tfs/_admin/_AgentPool

    The TFS URL doesn't work for me. How can I get the correct URL?

  4. In the left column, click the name of your agent pool. In the right column click Capabilities.
  5. Click Add capability and set the fields to cmake and yes.
  6. Click Save changes

How does CMake work? What arguments can I use?

About CMake

CMake Documentation

Do I need an agent?

You need at least one agent to run your build or release. Get an agent.

I can't select a default agent queue and I can't queue my build or release. How do I fix this?

See Agent pools and queues.

I use TFS on-premises and I don't see some of these features. Why not?

Some of these features are available only on VSTS and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.