All Projects → bsamseth → Cpp Project

bsamseth / Cpp Project

Licence: unlicense
Boiler plate template for C++ projects, with CMake, Doctest, Travis CI, Appveyor, Github Actions and coverage reports.

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Cpp Project

cpp14-project-template
A simple, cross-platform, and continuously integrated C++14 project template
Stars: ✭ 64 (-80.49%)
Mutual labels:  travis-ci, project-template, codecov, code-coverage
Modern Cpp Template
A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
Stars: ✭ 690 (+110.37%)
Mutual labels:  cmake, project-template, code-coverage, codecov
Hapi Starter Kit
Hapi.js based REST boilerplate which uses latest ES7/ES8 features (async/await) with code coverage and follows best pratices
Stars: ✭ 103 (-68.6%)
Mutual labels:  boilerplate, travis-ci, code-coverage
Example Cpp11 Cmake
Stars: ✭ 129 (-60.67%)
Mutual labels:  cmake, codecov
Polly
🔧 Collection of CMake toolchain files and scripts for cross-platform build and CI testing (GCC, Visual Studio, iOS, Android, Clang analyzer, sanitizers etc.)
Stars: ✭ 778 (+137.2%)
Mutual labels:  cmake, travis-ci
Moderncppchallengestudy
2018년 하반기에 진행하는 모던 C++ 문제 풀이 스터디 관련 자료입니다.
Stars: ✭ 29 (-91.16%)
Mutual labels:  cmake, code-review
Generator Jekyll Starter Kit
🚀 Jekyll Progressive Web App Generator.
Stars: ✭ 139 (-57.62%)
Mutual labels:  project-template, travis-ci
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (-38.41%)
Mutual labels:  cmake, code-coverage
Moderncppstarter
🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.
Stars: ✭ 2,381 (+625.91%)
Mutual labels:  cmake, codecov
travis-ci-tutorial-java
Just to learn how to use travis-ci in a java project!
Stars: ✭ 38 (-88.41%)
Mutual labels:  travis-ci, codecov
SpringBootRestAPI
A ready-to-use Template for Rest API using spring-boot-microservices, MongoDB as Database, Integrated with codecov and sonarqube, deployable to cloud.
Stars: ✭ 24 (-92.68%)
Mutual labels:  travis-ci, codecov
CPP Template
C++ project template : CMake, Test, Travis CI, Appveyor, CodeCoverage, Doxygen
Stars: ✭ 32 (-90.24%)
Mutual labels:  travis-ci, codecov
phpunit-travis-ci-coverage-example
phpUnit Testing on Travis-CI with Code Coverage on CodeCov
Stars: ✭ 30 (-90.85%)
Mutual labels:  travis-ci, codecov
Generate
A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
Stars: ✭ 238 (-27.44%)
Mutual labels:  project-template, boilerplate
Ros Travis Integration
ROS package continuous integration using travis-CI
Stars: ✭ 125 (-61.89%)
Mutual labels:  cmake, travis-ci
Warp Api Starter Template
A boilerplate template for starting a web services using Warp + SQLx (PostgreSQL) + Redis + Juniper (GraphQL). ❤️
Stars: ✭ 145 (-55.79%)
Mutual labels:  project-template, boilerplate
Cppbase
Boilerplate for a simple CMake-based C++ project
Stars: ✭ 156 (-52.44%)
Mutual labels:  cmake, boilerplate
Api Blueprint Boilerplate
Minimalistic boilerplate to quick-start API specification using API Blueprint description language.
Stars: ✭ 71 (-78.35%)
Mutual labels:  project-template, boilerplate
Node Flowtype Boilerplate
This boilerplate repository is outdated and no longer maintained. Instead, I strongly recommend to use TypeScript.
Stars: ✭ 104 (-68.29%)
Mutual labels:  project-template, boilerplate
CMake-codecov
CMake module for code coverage
Stars: ✭ 82 (-75%)
Mutual labels:  codecov, code-coverage

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status Build status Coverage Status codecov Codacy Badge Language grade: C/C++ Total alerts license Lines of Code Average time to resolve an issue Percentage of issues still open

Boiler plate for C++ projects

This is a boiler plate for C++ projects. What you get:

Demo of usage

Structure

.
├── CMakeLists.txt
├── app
│   └── main.cpp
├── include
│   ├── example.h
│   └── exampleConfig.h.in
├── src
│   └── example.cpp
└── tests
    ├── dummy.cpp
    └── main.cpp

Sources go in src/, header files in include/, main programs in app/, and tests go in tests/ (compiled to unit_tests by default).

If you add a new executable, say app/hello.cpp, you only need to add the following two lines to CMakeLists.txt:

add_executable(main app/main.cpp)   # Name of exec. and location of file.
target_link_libraries(main PRIVATE ${LIBRARY_NAME})  # Link the executable to lib built from src/*.cpp (if it uses it).

You can find the example source code that builds the main executable in app/main.cpp under the Build section in CMakeLists.txt. If the executable you made does not use the library in src/, then only the first line is needed.

Building

Build by making a build directory (i.e. build/), run cmake in that dir, and then use make to build the desired target.

Example:

> mkdir build && cd build
> cmake .. -DCMAKE_BUILD_TYPE=[Debug | Coverage | Release]
> make
> ./main
> make test      # Makes and runs the tests.
> make coverage  # Generate a coverage report.
> make doc       # Generate html documentation.

.gitignore

The .gitignore file is a copy of the Github C++.gitignore file, with the addition of ignoring the build directory (build/).

Services

If the repository is activated with Travis-CI, then unit tests will be built and executed on each commit. The same is true if the repository is activated with Appveyor.

If the repository is activated with Coveralls/Codecov, then deployment to Travis will also calculate code coverage and upload this to Coveralls.io and/or Codecov.io

Setup

Using the GitHub template

Click the Use this template button to make a new repository from this template.

NB: GitHub templates do not carry over submodules, which means you need to add those back before you can build the project. Run the following after you have generated your new project:

> git clone https://github.com/<your-username>/<your-repo-name>
> git submodule add https://github.com/onqtam/doctest.git external/doctest
> git commit -a --amend --no-edit
> git push --force

From command line

When starting a new project, you probably don't want the history of this repository. To start fresh you can use the setup script as follows:

> git clone --recurse-submodules https://github.com/bsamseth/cpp-project  # Or use ssh-link if you like.
> cd cpp-project
> bash setup.sh

The result is a fresh Git repository with one commit adding all files from the boiler plate.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].