|
|
@ -26,11 +26,12 @@ if("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "module") |
|
|
|
message(WARNING "gRPC_BENCHMARK_PROVIDER is \"module\" but BENCHMARK_ROOT_DIR is wrong") |
|
|
|
message(WARNING "gRPC_BENCHMARK_PROVIDER is \"module\" but BENCHMARK_ROOT_DIR is wrong") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
elseif("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "package") |
|
|
|
elseif("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "package") |
|
|
|
find_package(benchmark REQUIRED) |
|
|
|
# Use "CONFIG" as there is no built-in cmake module for benchmark. |
|
|
|
|
|
|
|
find_package(benchmark REQUIRED CONFIG) |
|
|
|
if(TARGET benchmark::benchmark) |
|
|
|
if(TARGET benchmark::benchmark) |
|
|
|
set(_gRPC_BENCHMARK_LIBRARIES benchmark::benchmark) |
|
|
|
set(_gRPC_BENCHMARK_LIBRARIES benchmark::benchmark) |
|
|
|
# extract the include dir from target's properties |
|
|
|
# extract the include dir from target's properties |
|
|
|
get_target_property(_gRPC_BENCHMARK_INCLUDE_DIR benchmark::benchmark INTERFACE_INCLUDE_DIRECTORIES) |
|
|
|
get_target_property(_gRPC_BENCHMARK_INCLUDE_DIR benchmark::benchmark INTERFACE_INCLUDE_DIRECTORIES) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
set(_gRPC_FIND_BENCHMARK "if(NOT benchmark_FOUND)\n find_package(benchmark)\nendif()") |
|
|
|
set(_gRPC_FIND_BENCHMARK "if(NOT benchmark_FOUND)\n find_package(benchmark CONFIG)\nendif()") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|