aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/benchmark.cmake
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2018-01-16 17:57:17 +0100
committerGravatar Jan Tattermusch <jtattermusch@google.com>2018-01-16 18:07:46 +0100
commit586f719898486303c0c990919bfba05a3e127a16 (patch)
treeb6238ad39200b74f20c70eba3987027d53348893 /cmake/benchmark.cmake
parenta41e997a8785243ee3c1e91c5dcfb73d698ac48d (diff)
cleanup cmake include directories
Diffstat (limited to 'cmake/benchmark.cmake')
-rw-r--r--cmake/benchmark.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake
index c6284225a3..753dc0696f 100644
--- a/cmake/benchmark.cmake
+++ b/cmake/benchmark.cmake
@@ -20,14 +20,17 @@ if("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "module")
add_subdirectory(${BENCHMARK_ROOT_DIR} third_party/benchmark)
if(TARGET benchmark)
set(_gRPC_BENCHMARK_LIBRARIES benchmark)
+ set(_gRPC_BENCHMARK_INCLUDE_DIR "${BENCHMARK_ROOT_DIR}/include")
endif()
else()
message(WARNING "gRPC_BENCHMARK_PROVIDER is \"module\" but BENCHMARK_ROOT_DIR is wrong")
endif()
elseif("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "package")
- find_package(benchmark)
+ find_package(benchmark REQUIRED)
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()")
endif()