Simple C++11 project boilerplate, using Google Test and Travis CI.
gitcmakeversion2.8or higher.gccorclangthat 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
srcis 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
)
testis 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-partyhosts the third party libraries.
They don't necessarily have to be submodules. You probably have to add_subdirectory and include_directories in CMakeLists.txt.
buildis where thecmakegenerated 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.