2012-06-22 22:32:29 +04:00
|
|
|
set(CTEST_RUN_CURRENT_SCRIPT 0)
|
2007-09-10 18:49:05 +04:00
|
|
|
if(NOT VERSION)
|
2016-10-03 16:08:04 +03:00
|
|
|
set(VERSION 3.7)
|
2010-03-06 02:26:43 +03:00
|
|
|
endif()
|
2014-02-26 22:18:38 +04:00
|
|
|
if(NOT DEFINED PROJECT_PREFIX)
|
|
|
|
set(PROJECT_PREFIX cmake-${VERSION})
|
|
|
|
endif()
|
2014-03-06 18:31:26 +04:00
|
|
|
if(NOT DEFINED DIR)
|
|
|
|
set(DIR "v${VERSION}")
|
2010-03-06 02:26:43 +03:00
|
|
|
endif()
|
2006-10-16 20:47:07 +04:00
|
|
|
file(GLOB FILES ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_PREFIX}*")
|
2011-06-02 06:32:42 +04:00
|
|
|
list(SORT FILES)
|
|
|
|
list(REVERSE FILES)
|
2006-10-16 20:47:07 +04:00
|
|
|
message("${FILES}")
|
|
|
|
set(UPLOAD_LOC
|
2014-03-06 18:31:26 +04:00
|
|
|
"kitware@www.cmake.org:/projects/FTP/pub/cmake/${DIR}")
|
2007-09-10 18:49:05 +04:00
|
|
|
set(count 0)
|
2006-10-16 20:47:07 +04:00
|
|
|
foreach(file ${FILES})
|
|
|
|
if(NOT IS_DIRECTORY ${file})
|
2007-09-10 18:49:05 +04:00
|
|
|
message("upload ${file} ${UPLOAD_LOC}")
|
2012-08-13 21:42:58 +04:00
|
|
|
execute_process(COMMAND
|
2006-10-16 20:47:07 +04:00
|
|
|
scp ${file} ${UPLOAD_LOC}
|
2012-06-22 22:32:29 +04:00
|
|
|
RESULT_VARIABLE result)
|
2006-10-16 20:47:07 +04:00
|
|
|
if("${result}" GREATER 0)
|
|
|
|
message(FATAL_ERROR "failed to upload file to ${UPLOAD_LOC}")
|
2011-06-02 06:32:42 +04:00
|
|
|
endif()
|
2012-06-22 22:32:29 +04:00
|
|
|
|
|
|
|
# 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")
|
2011-06-02 06:32:42 +04:00
|
|
|
endif()
|
2012-08-13 21:50:14 +04:00
|
|
|
endforeach()
|
2007-09-10 18:49:05 +04:00
|
|
|
if(${count} EQUAL 0)
|
|
|
|
message(FATAL_ERROR "Error no files uploaded.")
|
2010-03-06 02:26:43 +03:00
|
|
|
endif()
|