百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

run-cmake

> 开发工具
开源

GitHub 在 GitHub 上使用 CMake (CMakePresets.json)、Ninja 和 vcpkg 构建 C++ 应用程序的操作。

195 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

GitHub 在 GitHub 上使用 CMake (CMakePresets.json)、Ninja 和 vcpkg 构建 C++ 应用程序的操作。

  • Quickstart with a C++ project template
  • run-cmake@v10 runs CMake with CMakePresets.json
    • Quickstart with instructions
    • Best practises
      • Usage of github.workspace in multi platform workflows
    • Action reference: all input/output parameters
    • Flowchart
    • Samples
    • Who is using run-cmake
  • License
  • Disclaimer
  • Contributing

Quickstart with a C++ project template

Take a look at this C++ project template that applies all the following instructions, but also shows how to create a pure workflow without using special GitHub action that you cannot run locally on your development machine, but directly using the tools (CMake, Ninja, vcpkg, C++ compilers) you already use daily.

run-cmake@v10 runs CMake with CMakePresets.json

The run-cmake action runs CMake on GitHub workflows leveraging CMakePresets.json. Note that usage of CMakePresets.json is required.

Good companions are the run-vcpkg action and the get-cmake action.

Special features which provide added value over a pure workflow are:

  • annotations for CMake errors/warnings and for build (gcc/msvc/clang) errors/warnings are created inline in the changed source files the build run for, e.g.:

  • when necessary, it sets up the environment to build with the MSVC toolset.

  • automatic dump of log files created by CMake (e.g., CMakeOutput.log) and vcpkg. The content of those files flow into the workflow output log. The regex is customizable by the user.

The provided samples use GitHub hosted runners.

Good companions are the run-vcpkg action and the get-cmake action.

Quickstart with instructions

It is highly recommended to use:

  • a vcpkg.json manifest file to declaratively specify the dependencies.
  • the required CMakePresets.json file.
  • vcpkg as a submodule of your repository.
…

Best practises

Usage of github.workspace in multi platform workflows

Using github.workspace may be challenging since it contains backslashes on Windows which are interpreted as escape sequences when used as base path of additional arguments. To work around this, you could use the String.raw function which prevents the escape sequences from being processed, e.g.:

yaml
  with:
    configurePresetAdditionalArgs: "[ String.raw`-DD3D9_INCLUDE_DIR=${{ github.workspace }}/cache/Include` ]"

Action reference: all input/output parameters

Description of all input parameters: action.yml

Flowchart

Flowchart with related input in action.yml which let customize the flow.

…

If you want vcpkg env to avoid adding tool paths to PATH, provide a custom runVcpkgEnvFormatString without --tools, for example:

yaml
runVcpkgEnvFormatString: "[`env`, `--bin`, `--include`, `--python`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `set`]"

Samples

Checkmarks indicates whether the samples "uses" or specifies the thing in the header or whether it is true.

workflow link vcpkg as submodule explicit triplet vcpkg toolchain CMake's Presets Ninja run-vcpkg runs vcpkg CMake runs vcpkg
link ✅ ❌ ✅ ✅ ✅ ❌ ✅
link ❌ ❌ ✅ ✅ ✅ ❌ ✅
link ❌ ❌ ✅ ✅ ✅ ✅ ❌
link ✅ ✅ ✅ ✅ ✅ ❌ ✅

Who is using run-cmake

This graph shows the list of public repositories with more than 25 stars using run-cmake.

License

All the content in this repository is licensed under the MIT License.

Copyright © 2019-2020-2021-2022-2023-2024-2025 Luca Cappa

Disclaimer

The software is provided as is, there is no warranty of any kind. All users are encouraged to improve the source code with fixes and new features.

Contributing

Read CONTRIBUTING.md

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcmakecpluspluscppgit

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具