format: apply cmake-format

This commit is contained in:
Henry Schreiner
2020-07-30 16:20:10 -04:00
committed by Henry Schreiner
parent e2a96890e1
commit 94db5c5ed1
15 changed files with 472 additions and 402 deletions

View File

@@ -19,9 +19,14 @@ endif()
# Extract the version number from catch.hpp
function(_get_catch_version)
file(STRINGS "${CATCH_INCLUDE_DIR}/catch.hpp" version_line REGEX "Catch v.*" LIMIT_COUNT 1)
file(
STRINGS "${CATCH_INCLUDE_DIR}/catch.hpp" version_line
REGEX "Catch v.*"
LIMIT_COUNT 1)
if(version_line MATCHES "Catch v([0-9]+)\\.([0-9]+)\\.([0-9]+)")
set(CATCH_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}" PARENT_SCOPE)
set(CATCH_VERSION
"${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}"
PARENT_SCOPE)
endif()
endfunction()
@@ -34,11 +39,16 @@ function(_download_catch version destination_dir)
if(error)
message(FATAL_ERROR "Could not download ${url}")
endif()
set(CATCH_INCLUDE_DIR "${destination_dir}" CACHE INTERNAL "")
set(CATCH_INCLUDE_DIR
"${destination_dir}"
CACHE INTERNAL "")
endfunction()
# Look for catch locally
find_path(CATCH_INCLUDE_DIR NAMES catch.hpp PATH_SUFFIXES catch2)
find_path(
CATCH_INCLUDE_DIR
NAMES catch.hpp
PATH_SUFFIXES catch2)
if(CATCH_INCLUDE_DIR)
_get_catch_version()
endif()