Skip to content

A template project to build a C++/CMake/vcpkg based projects with IDE and GitHub Actions. Build is speed up with caching of artifacts.

License

Notifications You must be signed in to change notification settings

kwon-young/ImageStitcher

 
 

Repository files navigation

C++ project template

hosted-ninja-vcpkg_submod-autocachehosted-pure-workflow

This repository contains a C++ based project template that leverages vcpkg and CMake's CMakePresets.json to build and test the source code.

Advantages:

  • CMakePresets.json allows to run the same build either locally on your IDE and on GitHub runners.
  • vcpkg greatly helps in pulling and building the needed dependencies (e.g. libraries).

The repository provides also two GitHub workflows to build the project on GitHub runners. Both build and test the project using vcpkg and CMake, the only key difference is their implementation.

  • hosted-pure-workflow.yml: It is a pure workflow which does not use unneded GitHub Actions that cannot run locally on your development machine. On the other hand it is directly using the CMake, Ninja, vcpkg and the C++ build tools.
  • hosted-ninja-vcpkg_submod.yml: It is a concise workflow based on the custom GitHub Actions run-vcpkg and run-cmake which simplify and shorten the workflow content while adding some goodies like annotation and automatic caching and cache miss fallback strategy.

Rationale

The main idea of this C++ project template is to show how to obtain a perfectly reproducible software development process that can be run anywhere without any difference and no surprises, either locally using your preferred tools/IDE, either remotely on build agents typically used for continuous integration.

Integrated Development Environment (IDE) Support

The major C++ IDEs should already support CMakePresets.json and require no particular configuration. For example Visual Studio Code with the CMake Tools extension allows you to open the root folder of this repository, and select in the bottom status bar the presets for generating, building and testing the source code, as show in the following image:

CMake's preset selection in the status bar of Visual Studio Code

About

A template project to build a C++/CMake/vcpkg based projects with IDE and GitHub Actions. Build is speed up with caching of artifacts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 65.9%
  • CMake 34.1%