Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mateuspinto/cpp-boilerplate

Repository files navigation

C++ Boilerplate

Simple C++11 project boilerplate, using Google Test and Travis CI.

Requirements

  • git
  • cmake version 2.8 or higher.
  • gcc or clang that supports std=c++11.

Installation

Generate build files with:

$ git clone --recursive https://github.com/mateuspinto/cpp-boilerplate.git
$ cd cpp-boilerplate
$ mkdir build
$ cd build
$ cmake -D TESTS=ON ..

If you don't use git clone --recursive, you have to manually setup the submodules with:

$ git submodule update --init --recursive

Usage

  • src is where your code goes.

When you add a new file, don't forget to update CMakeLists.txt and execute cmake again.

add_library(core
# add your *.cpp here
)
  • test is where your tests go.

Same as src, when you add a new file, you have to update CMakeLists.txt and execute cmake again.

add_executables(tests
./tests/main-test.cpp
# add your *-test.cpp here
)
  • third-party hosts the third party libraries.

They don't necessarily have to be submodules. You probably have to add_subdirectory and include_directories in CMakeLists.txt.

  • build is where the cmake generated files and the executables will be.

From this folder:

- make # build
- ./main # execute project
- ./tests # execute tests

If you wan't to build from scratch again, you can just delete the folder and start again.

Thanks

Build done using MIT, see REFERENCES.md for more details.

About

My boilerplate for C++ 11 big projects. Based on vaalentin/cpp-boilerplate <3

Topics

Resources

Readme

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors