WSJT-X/CMake/download_kvasd.cmake
Bill Somerville 7eb9913324 Allow for errors reading kvasd MD5 hash file during build downloads
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4829 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-12-16 17:19:38 +00:00

35 lines
1.0 KiB
CMake

#
# CMake script to fetch kvasd binary for the current platform
#
set (kvasd_NAME ${URL}/${SYSTEM_NAME}/kvasd${EXECUTABLE_SUFFIX})
message (STATUS "file: ${kvasd_NAME}")
file (
DOWNLOAD ${kvasd_NAME}.md5 contrib/kvasd${EXECUTABLE_SUFFIX}.md5
TIMEOUT 120
STATUS status
LOG log
SHOW_PROGRESS
)
list (GET staus 0 rc)
if (rc)
message (WARNING "${status}")
message (FATAL_ERROR "${log}")
endif (rc)
file (READ contrib/kvasd${EXECUTABLE_SUFFIX}.md5 md5sum)
string (REGEX MATCH "[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]" md5sum "${md5sum}")
file (
DOWNLOAD ${kvasd_NAME} contrib/kvasd${EXECUTABLE_SUFFIX}
TIMEOUT 120
STATUS status
LOG log
SHOW_PROGRESS
EXPECTED_MD5 "${md5sum}"
)
list (GET status 0 rc)
if (rc)
message (WARNING "${status}")
message (FATAL_ERROR "${log}")
endif (rc)