{"id":16612526,"url":"https://github.com/lukka/cppcmakevcpkgtemplate","last_synced_at":"2025-04-05T13:05:21.733Z","repository":{"id":93352056,"uuid":"421788452","full_name":"lukka/CppCMakeVcpkgTemplate","owner":"lukka","description":"A template project to build a C++/CMake/vcpkg based projects with IDE and GitHub Actions. Build is sped up with caching of artifacts.","archived":false,"fork":false,"pushed_at":"2024-12-14T21:49:19.000Z","size":186,"stargazers_count":126,"open_issues_count":4,"forks_count":35,"subscribers_count":5,"default_branch":"v11","last_synced_at":"2025-03-29T12:04:28.335Z","etag":null,"topics":["cmake","cpp","cpp20","github-actions","template-repository","vcpkg"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-27T11:21:23.000Z","updated_at":"2025-03-28T08:10:42.000Z","dependencies_parsed_at":"2023-11-20T08:30:41.797Z","dependency_job_id":"139b9bdb-6e10-4829-a6ee-374c681492d7","html_url":"https://github.com/lukka/CppCMakeVcpkgTemplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukka%2FCppCMakeVcpkgTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukka%2FCppCMakeVcpkgTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukka%2FCppCMakeVcpkgTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukka%2FCppCMakeVcpkgTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukka","download_url":"https://codeload.github.com/lukka/CppCMakeVcpkgTemplate/tar.gz/refs/heads/v11","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp","cpp20","github-actions","template-repository","vcpkg"],"created_at":"2024-10-12T01:42:28.548Z","updated_at":"2025-04-05T13:05:21.708Z","avatar_url":"https://github.com/lukka.png","language":"CMake","readme":"[![hosted-ninja-vcpkg_submod-autocache](https://github.com/lukka/CppCMakeVcpkgTemplate/actions/workflows/hosted-ninja-vcpkg_submod.yml/badge.svg)](https://github.com/lukka/CppCMakeVcpkgTemplate/actions/workflows/hosted-ninja-vcpkg_submod.yml)\n[![hosted-pure-workflow](https://github.com/lukka/CppCMakeVcpkgTemplate/actions/workflows/hosted-pure-workflow.yml/badge.svg)](https://github.com/lukka/CppCMakeVcpkgTemplate/actions/workflows/hosted-pure-workflow.yml)\n\n# A C++ project template based on CMake and vcpkg\n\n## Content\nThis repository contains a `C++` based project template that leverages [vcpkg](https://github.com/microsoft/vcpkg) and [CMake](https://www.cmake.org)'s [CMakePresets.json](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) to build and test `C++` source code.\n\nSupports `Linux`/`macOS`/`Windows` on `x64` and `arm64` platforms.\n\n`vcpkg` is driven to use its [binary caching](https://learn.microsoft.com/en-us/vcpkg/users/binarycaching) feature storing the content in the GitHub Action cache, hence speeding up workflows by reusing previously built packages.\n\n## Key features:\n - `CMakePresets.json` allows to run the same build either _locally on your IDE_ and on _GitHub runners_.\n - `vcpkg` greatly helps in pulling and building the needed dependencies (e.g. libraries) which are cached for reuse on GitHub Action cache.\n\n## GitHub Action workflows\n\nThe repository provides also two GitHub workflows to build the project on [GitHub runners](https://github.com/actions/runner). Both builds and tests the project using `vcpkg` and `CMake`, the only key difference is their implementation:\n\n - [hosted-pure-workflow.yml](.github/workflows/hosted-pure-workflow.yml): it is a __pure__ workflow which does not use unneeded 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.\n-  [hosted-ninja-vcpkg_submod.yml](.github/workflows/hosted-ninja-vcpkg_submod.yml): it is a concise workflow based on the custom GitHub Actions [get-cmake](https://github.com/lukka/get-cmake), [run-vcpkg](https://github.com/lukka/run-vcpkg) and [run-cmake](https://github.com/lukka/run-cmake) which simplify and shorten the workflow verbosity while adding some goodies like vcpkg binary caching stored on GH's cache and inline error annotations.\n\n## Rationale\n\nThe 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.\n\n## Integrated Development Environment (IDE) Support\n\nThe major `C++` IDEs should already support `CMakePresets.json` and require no particular configuration. \n\nFor example with [Visual Studio Code](https://code.visualstudio.com/) and the [CMake Tools extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) you can open the root folder of this repository, and then build, test, format using the CMake Project Outline window, as show in the following image:\n\n![CMake's Project Outline window of Visual Studio Code](./img/vscode_cmake_project_outline.png)\n\n\u003cbr\u003e\n\n# License\n\nAll the content in this repository is licensed under the [MIT License](LICENSE.txt).\n\nCopyright © 2021-2022-2023-2024 Luca Cappa\u003c/br\u003e\nCopyright © 2024 Benney Au\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukka%2Fcppcmakevcpkgtemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukka%2Fcppcmakevcpkgtemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukka%2Fcppcmakevcpkgtemplate/lists"}