diff --git a/cmake/FetchDataFile.cmake.in b/cmake/FetchDataFile.cmake.in index 310e8f9d5c..e781f72a5e 100644 --- a/cmake/FetchDataFile.cmake.in +++ b/cmake/FetchDataFile.cmake.in @@ -4,15 +4,27 @@ # Download, Decompress, and possibly copy data archive # message(STATUS "[DATA DOWNLOAD] @ARGS_ARCHIVE_NAME@") # -------------------------------------------------------------------------------------------------- +string(TIMESTAMP time_stamp_start %s) file(DOWNLOAD https://github.com/BlueQuartzSoftware/complex/releases/download/Data_Archive/@ARGS_ARCHIVE_NAME@ "@ARGS_DREAM3D_DATA_DIR@/TestFiles/@ARGS_ARCHIVE_NAME@" EXPECTED_HASH SHA512=@ARGS_SHA512@ - SHOW_PROGRESS + # SHOW_PROGRESS STATUS result ) -# message(STATUS "result: '${result}'") +string(TIMESTAMP time_stamp_end %s) list(GET result 1 status) string(REPLACE "\"" "" status "${status}") + +if("${status}" STREQUAL "No error") + math(EXPR time_diff "${time_stamp_end} - ${time_stamp_start}" OUTPUT_FORMAT DECIMAL) # value is set to "1000" + file(SIZE "@ARGS_DREAM3D_DATA_DIR@/TestFiles/@ARGS_ARCHIVE_NAME@" file_size) + if(NOT "${time_diff}" STREQUAL "0") + math(EXPR bandwidth "${file_size} / ${time_diff}" OUTPUT_FORMAT DECIMAL) # value is set to "1000" + message(STATUS "@ARGS_ARCHIVE_NAME@ Download Complete: ${bandwidth} bytes/sec") + else() + message(STATUS "@ARGS_ARCHIVE_NAME@ Download Complete") + endif() +endif() # message(STATUS "status: '${status}'") # --------------------------------------------------------------------------------------------------