Git Product home page Git Product logo

cpp-project-template's Introduction

cpp-project-template

A basic template for C++ projects that use CMake and Clang

Project organization

Alt text

  • build/ is where the build files are stored.
  • build/bin/ is where the built binaries are stored.
  • src/ is where the source code files are stored.
  • tests/ is where the unit-test code is stored along with Catch, the unit test framework.
  • build.sh is the build script for the main program and the unit tests.
  • run.sh is the script that launches the main program or the unit tests.

Before using

Don't forget to change the project name and the binary name in the CMakeLists.txt files in both the src/ and the tests/ folders. Look for project_name and bin_name.

Usage

The project offers two scripts, one for building and the other for running. Each script has various options that can be displayed on the terminal like so:

./build.sh -h
./run.sh -h

Building

Running the build.sh script will build the project with the default parameters which are: debug mode and no unit-tests.

The building process can be customized with the following parameters:

  • -d or -debug build in DEBUG mode.
  • -r or -release build in RELEASE mode.
  • -t or -test build tests.
  • -c or -clean remove the CMakeCache.txt file.
  • -tc or -total-clean remove the entire build directory.
  • -h or -help display the help and exit.

Running

Running the run.sh script will simply launch the project generated binary.

The running process can be customized with the following parameters:

  • -d or -debug run the program through the GDB debugger.
  • -t or -test run the unit-tests.
  • -h or -help display the help and exit.

Authors

  • Othmane AIT EL CADI - Initial work - dartzon

License

This project is licensed under the MIT License - see the LICENSE.md file for details

cpp-project-template's People

Contributors

dartzon 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.