Build: CMake

Last Update: 3/6/2017

Team Services | TFS 2017 | TFS 2015 | Previous versions (XAML builds)

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 the hosted pool?

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:

    • Team Services: https://{your_account}.visualstudio.com/_admin/_AgentPool
    • TFS 2017: 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 Hosted. 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 your agent machine.
  3. In your web browser, navigate to the Agent pools control panel tab:

    • Team Services: https://{your_account}.visualstudio.com/_admin/_AgentPool
    • TFS 2017: 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 Hosted. 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 a build agent?

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

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

See queues.

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

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