Mark the find_package(benchmark) with required

Add the REQUIRED flag to the find_package command to find the Google
benchmark package. Without that flag, the find_package command will
happily pass if the benchmarks are not found.

However, if benchmarks is not found, then the CMake configure will then
fail because the benchmark::benchmark library is not defined. That is a
confusing error to get. Since benchmark is not a typical thing installed
on a system, this can be problematic.
This commit is contained in:
Kenneth Moreland 2020-01-09 12:28:48 -07:00
parent a5c686214b
commit 7e49c11313

@ -10,7 +10,7 @@
# Find Google Benchmark. Note that benchmark_DIR must be pointed at an
# installation, not a build directory.
find_package(benchmark)
find_package(benchmark REQUIRED)
function(add_benchmark)
set(options)