diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1811e99a0d..170c38aa36 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -707,9 +707,9 @@ endif() if (onnxruntime_BUILD_BENCHMARKS) if (onnxruntime_PREFER_SYSTEM_LIB) - find_package(benchmark) + find_package(benchmark CONFIG) endif() - if (benchmark_FOUND) + if (TARGET benchmark::benchmark) message("Use benchmark from preinstalled system lib") else() message("Use benchmark from submodule")