使用此任务可使用 CMake 跨平台构建系统进行构建。
语法
# CMake v1
# Build with the CMake cross-platform build system.
- task: CMake@1
inputs:
#workingDirectory: 'build' # string. Alias: cwd. Working Directory. Default: build.
#cmakeArgs: # string. Arguments.
# Advanced
#runInsideShell: false # boolean. Run cmake command inside shell. Default: false.
# CMake v1
# Build with the CMake cross-platform build system.
- task: CMake@1
inputs:
#workingDirectory: 'build' # string. Alias: cwd. Working Directory. Default: build.
#cmakeArgs: # string. Arguments.
输入
workingDirectory
-
工作目录
输入别名: cwd
.
string
。 默认值:build
。
运行 CMake 时的当前工作目录。
如果您指定相对路径,则它是相对于您的存储库的。 例如,如果指定 build
,则结果与指定 $(Build.SourcesDirectory)\build
时的结果相同。
您还可以在存储库外部指定完整路径,并且可以使用 变量。 例如:$(Build.ArtifactStagingDirectory)\build
如果您指定的路径不存在,则 CMake 会创建该路径。
cmakeArgs
-
参数
string
。
传递给 CMake 的参数。
runInsideShell
-
在 shell 中运行 cmake 命令
boolean
。 默认值:false
。
CMake 参数的处理方式与在特定于作系统的 shell 中处理的方式相同。 此 input 可用于处理参数字符串内的环境变量。
任务控制选项
除任务输入之外,所有任务都具有控制选项。 有关详细信息,请参阅 控件选项和常见任务属性。
输出变量
没有。
注解
使用此任务可使用 CMake 跨平台构建系统进行构建。
如何为 Microsoft 托管的代理启用 CMake?
Microsoft 托管的代理已安装 CMake,因此您无需执行任何作。 您无需在文件中添加 azure-pipelines.yml
对 CMake 的要求。