Skip to content

Commit

Permalink
add some comments about black magic
Browse files Browse the repository at this point in the history
  • Loading branch information
dpshelio committed Sep 10, 2018
1 parent c355532 commit fe5cd50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/LookUpCatch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ set(Catch_FILE "${EXTERNAL_ROOT}/include/catch.hpp")
file(MAKE_DIRECTORY "${EXTERNAL_ROOT}/include")
file(DOWNLOAD ${Catch_URL} "${Catch_FILE}")

# I imagine this is checking whether the file download
# is long enough. This could be the case that cmake hasn't
# been built with ssl support and a https download will fail.
file(READ "${Catch_FILE}" CATCHSTRING LIMIT 1000)
string(LENGTH "${CATCHSTRING}" CATCHLENGTH)


# In case the download fails with cmake then try with wget/curl
if(NOT CATCHLENGTH GREATER 500)
find_package(Wget)
if(WGET_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion scripts/AddCatchTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if(NOT Catch_FOUND AND Catch_WANTED_VERSION)
lookup_package(Catch REQUIRED ARGUMENTS VERSION ${Catch_WANTED_VERSION})
else(NOT Catch_FOUND)
elseif(NOT Catch_FOUND)
lookup_package(Catch REQUIRED)
endif()

Expand Down

0 comments on commit fe5cd50

Please sign in to comment.