Skip to content

bitjson/cpp-boilerplate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 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 git@github.com:vaalentin/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.

License

MIT, see LICENSE.md for more details.

About

Simple C++11 project boilerplate.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 59.1%
  • CMake 40.9%