Commit afc6f790 authored by Roman Donchenko's avatar Roman Donchenko

Inlined the getMD5 macro, which no longer saves us anything.

parent e5740784
...@@ -82,12 +82,8 @@ endif() ...@@ -82,12 +82,8 @@ endif()
set(tbb_tarball "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_ver}_src.tgz") set(tbb_tarball "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_ver}_src.tgz")
set(tbb_src_dir "${CMAKE_CURRENT_BINARY_DIR}/${tbb_ver}") set(tbb_src_dir "${CMAKE_CURRENT_BINARY_DIR}/${tbb_ver}")
macro(getMD5 filename varname)
file(MD5 "${filename}" ${varname})
endmacro()
if(EXISTS "${tbb_tarball}") if(EXISTS "${tbb_tarball}")
getMD5("${tbb_tarball}" tbb_local_md5) file(MD5 "${tbb_tarball}" tbb_local_md5)
if(NOT tbb_local_md5 STREQUAL tbb_md5) if(NOT tbb_local_md5 STREQUAL tbb_md5)
message(WARNING "Local copy of TBB source tarball has invalid MD5 hash: ${tbb_local_md5} (expected: ${tbb_md5})") message(WARNING "Local copy of TBB source tarball has invalid MD5 hash: ${tbb_local_md5} (expected: ${tbb_md5})")
file(REMOVE "${tbb_tarball}") file(REMOVE "${tbb_tarball}")
...@@ -103,7 +99,7 @@ if(NOT EXISTS "${tbb_tarball}") ...@@ -103,7 +99,7 @@ if(NOT EXISTS "${tbb_tarball}")
if(NOT __statvar EQUAL 0) if(NOT __statvar EQUAL 0)
message(FATAL_ERROR "Failed to download TBB sources: ${tbb_url}") message(FATAL_ERROR "Failed to download TBB sources: ${tbb_url}")
endif() endif()
getMD5("${tbb_tarball}" tbb_local_md5) file(MD5 "${tbb_tarball}" tbb_local_md5)
if(NOT tbb_local_md5 STREQUAL tbb_md5) if(NOT tbb_local_md5 STREQUAL tbb_md5)
file(REMOVE "${tbb_tarball}") file(REMOVE "${tbb_tarball}")
message(FATAL_ERROR "Downloaded TBB source tarball has invalid MD5 hash: ${tbb_local_md5} (expected: ${tbb_md5})") message(FATAL_ERROR "Downloaded TBB source tarball has invalid MD5 hash: ${tbb_local_md5} (expected: ${tbb_md5})")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment