2014-04-12 08:42:37 -04:00
|
|
|
#
|
|
|
|
# CMake script to fetch kvasd binary for the current platform
|
|
|
|
#
|
2014-12-16 12:58:01 -05:00
|
|
|
set (kvasd_NAME "${URL}/${SYSTEM_NAME}/kvasd${EXECUTABLE_SUFFIX}")
|
|
|
|
set (kvasd_target "contrib/kvasd${EXECUTABLE_SUFFIX}")
|
2014-11-27 12:17:19 -05:00
|
|
|
|
2014-12-16 12:58:01 -05:00
|
|
|
message (STATUS "downloading file: ${kvasd_NAME}.md5")
|
2014-11-27 12:17:19 -05:00
|
|
|
file (
|
2014-12-16 12:58:01 -05:00
|
|
|
DOWNLOAD "${kvasd_NAME}.md5" "${kvasd_target}.md5"
|
2014-11-27 12:17:19 -05:00
|
|
|
TIMEOUT 120
|
|
|
|
STATUS status
|
|
|
|
LOG log
|
|
|
|
SHOW_PROGRESS
|
|
|
|
)
|
2014-12-16 12:58:01 -05:00
|
|
|
list (GET status 0 rc)
|
2014-11-27 12:17:19 -05:00
|
|
|
if (rc)
|
|
|
|
message (WARNING "${status}")
|
|
|
|
message (FATAL_ERROR "${log}")
|
|
|
|
endif (rc)
|
2014-12-16 12:58:01 -05:00
|
|
|
file (READ "${kvasd_target}.md5" md5sum)
|
2014-12-16 12:19:38 -05:00
|
|
|
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}")
|
2014-11-27 12:17:19 -05:00
|
|
|
|
2014-12-16 19:55:00 -05:00
|
|
|
if (EXISTS "${kvasd_target}")
|
|
|
|
file (MD5 "${kvasd_target}" current_md5sum)
|
|
|
|
endif (EXISTS "${kvasd_target}")
|
2014-12-16 12:58:01 -05:00
|
|
|
if (NOT "${md5sum}" STREQUAL "${current_md5sum}")
|
|
|
|
message (STATUS "downloading file: ${kvasd_NAME}")
|
|
|
|
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)
|
|
|
|
else (NOT "${md5sum}" STREQUAL "${current_md5sum}")
|
|
|
|
message (STATUS "file: ${kvasd_NAME} up to date")
|
|
|
|
endif (NOT "${md5sum}" STREQUAL "${current_md5sum}")
|