Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to select a particular tag for Google's benchmark #63

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)