GithubHelp home page GithubHelp logo

rdamacedo / cpp_skeleton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gnzlbg/cpp_skeleton

0.0 2.0 0.0 240 KB

C++ Projekt Skeleton

Home Page: https://gnzlbg.github.com/cpp_skeleton

License: Boost Software License 1.0

CMake 76.41% Python 6.99% C++ 7.34% HTML 9.26%

cpp_skeleton's Introduction

C++ Skeleton Build Status Coverage Status

Your standard C++ project skeleton

Disclaimer

This is buggy and unfinished, use at your own risk!

This project is a fork from Hana's build system, so all of the credit goes to Louis Dione for the great work he is doing. It also steals some ideas from the build systems of Paul Fultz II FIT's library and Eric Niebler's range-v3 library. It is released under the Boost Software license, but note that some of the libraries that are optionally provided might have a different license.

Overview

Setting up a modern C++ project with Continuous Integration is a time-consuming task. The amount of tools available is daunting, and one really wants to use them all: CMake, gh-pages and Doxygen for documentation, Travis-CI for continuous integration, Coveralls for displaying code coverage reports, clang-format for auto-formatting, valgrind, sanitizers, swang, static-analyzer, and many more!

The aim of this project is to give you a fully-functional starting point for your own projects, so that you can skip setting up most of these tools correctly. Every project is different tho, so we expect you to modify your build system over time. This skeleton is just there to give you the fundamentals, anything else is up to you! Send a PR if you find something is missing.

What you get

  • CMake as a meta-build system:
    • debug/release builds,
    • high-optimization for release builds,
    • extensive warnings enabled out-of-the-box,
    • support for running tests and examples with valgrind and AddressSanitizer,
    • support for generating code coverage from tests and examples.
  • Travis-CI is used for unit-testing:
  • Coveralls shows per-line code coverage.
  • Automatic Doxygen documentation generation and deployment to gh-pages.

Getting started

  1. Fork this repository and check-out your fork.
  2. Add your repository to Travis-CI and Coveralls.
  3. Run bootstrap.py script to configure it to your needs.
    • Replace the secure token with your own and create a gh-pages branch that is empty.
  4. Commit your changes to your repository (including the gh-pages branch).
  5. Start working on your project.

CMake configuration options

  • PROJECT_NAME_ENABLE_VALGRIND: Run the unit tests and examples under valgrind if it is found.
  • PROJECT_NAME_ENABLE_ASAN: Run the unit tests and examples using AddressSanitizer.
  • PROJECT_NAME_ENABLE_COVERAGE: Run the unit tests and examples with code coverage instrumentation.
  • PROJECT_NAME_ENABLE_WERROR: Fail and stop if a warning is triggered.
  • PROJECT_NAME_ENABLE_DEBUG_INFORMATION: Includes debug information in the binaries.
  • PROJECT_NAME_ENABLE_ASSERTIONS: Enables assertions.

CMake targets

  • make: Compiles top-level targets.
  • make tests: Compiles the tests.
  • make examples: Compiles the examples.
  • make check: Runs the test and the examples.
  • make doc: Generates the documentation.

Directory structure

The directory structure is as follows:

benchmark/            : Benchmarks (reserved for future usage)
cmake/                : CMake files
include/project_name/ : Project header files
site/                 : website (reserved for future usage)
src/                  : Source files (reserved for future usage)
test/                 : Unit-tests 
.clang-format         : clang-format configuration
.travis.yml           : Travis-CI configuration
.gitignore            : With C++ defaults
CMakeLists.txt        : CMake configuration

What remains to be done

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.