cpp-best-practices / gui_starter_template

A template CMake project to get you started with C++ and tooling
The Unlicense
2.51k stars 445 forks source link

google benchmark support #76

Open marcpawl opened 4 years ago

marcpawl commented 4 years ago

Would be nice to have Google benchmark as one of the optional dependencies

ddalcino commented 4 years ago

I agree; a CMake flag that people can set would be a great way to encourage our users to benchmark their code.

Please note that it is trivial to add Google Benchmark as a dependency yourself, since it is hosted on Conan. Just add this line, perhaps within a conditional, to cpp_starter_project/CMakeLists.txt:

set(CONAN_EXTRA_REQUIRES ${CONAN_EXTRA_REQUIRES} benchmark/1.5.1)

An argument could be made that benchmarks should be required rather than optional, and that Google Benchmark actually belongs in cpp_starter_project/cmake/Conan.cmake right next to catch2, as an equally important part of every project. This is a matter of opinion though.

aminya commented 4 years ago

I prefer that we add support for Coz too. It is one of the best tools for benchmarking and profiling.