Skip to content

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

Notifications You must be signed in to change notification settings

mateuspinto/cpp-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Boilerplate

Build Status

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published