Forked from opatry's template:
"This project is used as a basis for any C++ project built with CMake. Its purpose is to provide a full featured (code coverage, unit tests, static analysis, …) and cross platform build. It tries to use CMake in the most effective way."
Technology | Description | Links |
---|---|---|
C++11 | Supported standard. Will add C++14 eventually. | * |
CMake | Build system | * |
CPack | Packaging system integrated with CMake | * |
Google Test | Google's C++ Testing Framework | * |
Doxygen | Code documentation | * |
cpplint | Open source lint-like tool from Google | * * |
Cppcheck | A tool for static C/C++ code analysis | * |
gcov/gcovr | Code coverage | * * |
Travis CI | Continuous integration | * |
Coveralls | Code coverage history and stats | * * |
If you wish to work on a C++ project using this template, please read the customization instructions file. If there are any problems, please open an issue here!
From the Travis scripts (Ubuntu):
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo add-apt-repository --yes ppa:kubuntu-ppa/backports
sudo apt-get update -qq
sudo apt-get install -qq cmake doxygen g++-4.8 python-pip cppcheck valgrind ggcov
sudo pip install Pygments
sudo pip install gcovr
sudo pip install cpp-coveralls
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.8 80
./build.sh debug
Debug information (-g), zero-level optimization (-O0) and gcov flags.
./build.sh release
Third-level optimization (-O3) and treat warnings as errors (-Werror)
Both will produce:
- Project Executable (build/src/PROJECTNAME_exec)
- Test Executable (build/src/PROJECTNAME_GTest)
- Doxygen documentation (build/doc/html/)
./build.sh debug windows
and ./build.sh release windows
Will use MinGW to cross compile to Windows
./utils/travis/after_success.sh
This will produce the following reports in build/reports/:
And if this script is ran from within Travis-CI, it will publish all the reports, doxygen documentation to the Project Webpage in the gh-pages branch, and it will publish the coverage report to Coveralls.
The GitHub webpage is available here: Project Webpage
As mentioned, all the documentation and reports are automatically published to it from within Travis-CI, using the after success script. The idea is that every project derived from this template can also have this format of auto-publishing stuff.
To achieve this, you must have an access token to your repository, so Travis-CI can push to the gh-pages branch. A nice tutorial can be found here in steps 1 through 4.
The Google Test framework was originally downloaded through SVN on every build, but I didn't want any internet connection dependency.
Through dmonopoly's project I learned how to include it with my project (so thanks).
#License
See LICENSE file.