diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2018-02-07 15:57:23 +0100 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2018-02-07 16:20:22 +0100 |
commit | 6750d42ef1811cb5527f7eaa13fdbbd0cde4b8ef (patch) | |
tree | 7531d3c2bb4a1b113c1dad63ce985ccc76b34783 /cmake/benchmark.cmake | |
parent | fb369d95677b85995071e8255230c8bd7e291216 (diff) |
fine tune cmake find_package usage
Diffstat (limited to 'cmake/benchmark.cmake')
-rw-r--r-- | cmake/benchmark.cmake | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index 753dc0696f..2b4c20f2db 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -26,11 +26,12 @@ if("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "module") message(WARNING "gRPC_BENCHMARK_PROVIDER is \"module\" but BENCHMARK_ROOT_DIR is wrong") endif() 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) set(_gRPC_BENCHMARK_LIBRARIES benchmark::benchmark) # extract the include dir from target's properties get_target_property(_gRPC_BENCHMARK_INCLUDE_DIR benchmark::benchmark INTERFACE_INCLUDE_DIRECTORIES) 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() |