Giter Site home page Giter Site logo

template-cpp-project's Introduction

After installing this template

This is just a template to start working in a C++ project. It includes basic folder structure using CMake and Catch2 test framework. It also included some basic Conan files to grab dependencies and start working with CIs.

Search for TODO comments to apply the changes that are required to your specific project and spend some time having a look to '.github/workflows' files to adjust them to your needs (usually you can just remove all files starting with underscore).

Most of this template is designed to work together with 'https://github.com/jgsogo/conan-recipes' repository, you might need to move some of those files to your own organization.

In order to work with jgsogo/conan-recipes there are two secrets expected in this repository:

  • APP_RECIPES_APP_ID:
  • APP_RECIPES_PRIVATE_KEY:

These secreats are used by .github/workflows/published_release.yml to open a PR to jgsogo/conan-recipes when a new release is published in this repository.

Build and tests Build and tests

Consume the library

This library is available as a Conan package in my personal remote repository. To consume it, you just need to add the remote:

conan remote add sogo https://sogo.jfrog.io/artifactory/api/conan/conan-center
conan install <library_name>/<library_version>@jgsogo/stable

Or, add the remote and list the reference in your conanfile.txt/py file.

Build and run locally

mkdir cmake-build-xxxx && cd cmake-build-xxxx
conan lock create --profile:host=../.conan/profiles/cpp20 --profile:build=default --lockfile=../lockfile.json --lockfile-out=lockfile.json --name=cpp-project --version=0.1 ../conanfile.txt --build --update
conan install --lockfile=lockfile.json ../conanfile.txt --build=missing --generator=virtualenv

Update dependencies

conan lock create --name=cpp-project --version=0.1 --base --lockfile-out lockfile.json --build --profile:host=.conan/profiles/cpp20 --profile:build=default conanfile.txt

template-cpp-project's People

Contributors

jgsogo avatar jgsogo-conan-recipes[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

template-cpp-project's Issues

Add folder with scripts

  • post_install: after cloning this template, something to check that everything is configured as expected:
    • All TODO entries have been removed and/or changed
    • Project name matches the name of the repository
    • Credentials/secrets are added
    • Optionally remove .github/workflow/_xxx.yml files (they are consumed from this repo)
  • add_dep: adds a Conan dependency by adding it to conanfile.txt and regenerating the lockfile.
  • update_template: update files in the current project with files from the template

Centralize docker-image to use

See where we can write the docker image to use, so it is the same for all the pipelines. Use some global-level variable (a secret/environment)?

  • How forks should use it? ...probably there should be a default.

"Build the build requires" step should be optional

That step is not needed if all build-requires are available for the default configuration: if we are using a stable docker image from ConanCenter.

Approach with --build missing doesn't always work for transitive build-requires (see conan-io/conan#10345)

It should be possible to inspect (jq) and check if any build-requires are missing. If some are missing, then trigger the step, if not skip it.

[bug] Update_lockfile fails

Although the PR is created, the CI fails:

  • it fails while creating the PR
  • the name of the repository is not available when it is triggered by scheduler

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.