summaryrefslogtreecommitdiffstats
path: root/Utilities/Release
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-06-22 18:32:29 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-06-22 18:32:29 (GMT)
commit214589b1f068800721c582b6983d718d5a66c04b (patch)
tree167fa74da68797b194ac9bc69d7cddfe5718fe9c /Utilities/Release
parent03022877399735b930ae44f1fd2d19d64e4a8a2f (diff)
downloadCMake-214589b1f068800721c582b6983d718d5a66c04b.zip
CMake-214589b1f068800721c582b6983d718d5a66c04b.tar.gz
CMake-214589b1f068800721c582b6983d718d5a66c04b.tar.bz2
Add ability to run as a ctest -S script also
Then, use ctest_sleep to separate uploads by at least one second each, so that the files on the web server all get distinct time stamps. Then, when viewed on the web server, sorted by time, they are also sorted alphabetically.
Diffstat (limited to 'Utilities/Release')
-rw-r--r--Utilities/Release/upload_release.cmake16
1 files changed, 13 insertions, 3 deletions
diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake
index dc6c78f..bd79296 100644
--- a/Utilities/Release/upload_release.cmake
+++ b/Utilities/Release/upload_release.cmake
@@ -1,4 +1,7 @@
-set(PROJECT_PREFIX cmake-)
+set(CTEST_RUN_CURRENT_SCRIPT 0)
+if(NOT DEFINED PROJECT_PREFIX)
+ set(PROJECT_PREFIX cmake-)
+endif()
if(NOT VERSION)
set(VERSION 2.8)
endif()
@@ -18,11 +21,18 @@ foreach(file ${FILES})
message("upload ${file} ${UPLOAD_LOC}")
execute_process(COMMAND
scp ${file} ${UPLOAD_LOC}
- RESULT_VARIABLE result)
- math(EXPR count "${count} + 1")
+ RESULT_VARIABLE result)
if("${result}" GREATER 0)
message(FATAL_ERROR "failed to upload file to ${UPLOAD_LOC}")
endif()
+
+ # Pause to give each upload a distinct (to the nearest second)
+ # time stamp
+ if(COMMAND ctest_sleep)
+ ctest_sleep(2)
+ endif()
+
+ math(EXPR count "${count} + 1")
endif()
endforeach(file)
if(${count} EQUAL 0)