Giter VIP home page Giter VIP logo

cppcmakevcpkgtemplate's Introduction

hosted-ninja-vcpkg_submod-autocache hosted-pure-workflow

A C++ project template

Content

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

Supports Linux/macOS/Windows on x64 and arm64.

Key features:

  • 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).

GitHub Action workflows

The repository provides also two GitHub workflows to build the project on GitHub runners. Both builds and tests 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 get-cmake, run-vcpkg and run-cmake which simplify and shorten the workflow content while adding some goodies like inline error annotations, automatic caching, cache miss fallback strategy and other benefits.

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 let you to open the root folder of this repository, and select in the status bar the CMake preset (e.g. ninja-multiconfiguration-vcpkg), as show in the following image:

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

cppcmakevcpkgtemplate's People

Contributors

lukka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.