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