Simple C++11 project boilerplate, using Google Test and Travis CI.
git
cmake
version2.8
or higher.gcc
orclang
that supportsstd=c++11
.
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
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 thecmake
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.
Build done using MIT, see REFERENCES.md for more details.