Skip to content

Commit

Permalink
Adds option to select a particular tag for Google's benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
dpshelio committed Jun 19, 2018
1 parent 6716c90 commit 0d54641
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions modules/LookUpGBenchmark.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Installs GBenchmark into build directory
if(GBenchmark_ARGUMENTS)
cmake_parse_arguments(GBenchmark "" "GIT_REPOSITORY" "" ${GBenchmark_ARGUMENTS})
cmake_parse_arguments(GBenchmark
""
"GIT_REPOSITORY;GIT_TAG"
""
${GBenchmark_ARGUMENTS}
)
endif()

if(NOT GBenchmark_GIT_REPOSITORY)
set(GBenchmark_GIT_REPOSITORY https://github.com/google/benchmark.git)
endif()

if(NOT GBenchmark_GIT_TAG)
set(GBenchmark_GIT_TAG master)
endif()

include(PassonVariables)
passon_variables(GTest
passon_variables(GBenchmark
FILENAME "${EXTERNAL_ROOT}/src/GBenchmarkVariables.cmake"
PATTERNS
"CMAKE_[^_]*_R?PATH"
Expand All @@ -20,6 +30,7 @@ passon_variables(GTest
ExternalProject_Add(
Lookup-GBenchmark
GIT_REPOSITORY ${GBenchmark_GIT_REPOSITORY}
GIT_TAG ${GBenchmark_GIT_TAG}
PREFIX "${EXTERNAL_ROOT}"
# Force separate output paths for debug and release builds to allow easy
# identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands
Expand All @@ -30,7 +41,10 @@ ExternalProject_Add(

# Wrap download, configure and build steps in a script to log output
UPDATE_COMMAND ""
LOG_DOWNLOAD ON LOG_CONFIGURE ON LOG_BUILD ON LOG_INSTALL ON
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
)

add_recursive_cmake_step(Lookup-GBenchmark DEPENDEES install)

0 comments on commit 0d54641

Please sign in to comment.