Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 1481e66

Browse files
committed
add benchmark to fetchcontent
1 parent 71fd6a7 commit 1481e66

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

cmake/OpenCensusDeps.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ fetchcontent_declare(prometheus
2929
https://github.com/jupp0r/prometheus-cpp
3030
GIT_TAG
3131
master)
32+
fetchcontent_declare(benchmark
33+
GIT_REPOSITORY
34+
https://github.com/google/benchmark
35+
GIT_TAG
36+
master)
3237

3338
fetchcontent_getproperties(googletest)
3439
if(BUILD_TESTING)
@@ -72,3 +77,10 @@ if(NOT prometheus_POPULATED)
7277
add_subdirectory(${prometheus_SOURCE_DIR} ${prometheus_BINARY_DIR}
7378
EXCLUDE_FROM_ALL)
7479
endif()
80+
81+
fetchcontent_getproperties(benchmark)
82+
if(NOT benchmark_POPULATED)
83+
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Enable building the unit tests which depend on gtest" FORCE)
84+
fetchcontent_populate(benchmark)
85+
add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR} EXCLUDE_FROM_ALL)
86+
endif()

0 commit comments

Comments
 (0)