From 7e49c113139b461b5d1aed24de2c619161f4b706 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Thu, 9 Jan 2020 12:28:48 -0700 Subject: [PATCH] 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. --- benchmarking/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarking/CMakeLists.txt b/benchmarking/CMakeLists.txt index 40e96b7b6..ba603e031 100644 --- a/benchmarking/CMakeLists.txt +++ b/benchmarking/CMakeLists.txt @@ -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)