cmake/Utilities/Release/upload_release.cmake

40 lines
998 B
CMake
Raw Normal View History

2013-03-16 19:13:01 +02:00
set(CTEST_RUN_CURRENT_SCRIPT 0)
if(NOT VERSION)
2016-07-09 11:21:54 +02:00
set(VERSION 3.6)
2015-04-27 22:25:09 +02:00
endif()
if(NOT DEFINED PROJECT_PREFIX)
set(PROJECT_PREFIX cmake-${VERSION})
2010-06-23 01:18:35 +03:00
endif()
2015-04-27 22:25:09 +02:00
if(NOT DEFINED DIR)
set(DIR "v${VERSION}")
2010-06-23 01:18:35 +03:00
endif()
file(GLOB FILES ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_PREFIX}*")
2011-06-19 15:41:06 +03:00
list(SORT FILES)
list(REVERSE FILES)
message("${FILES}")
set(UPLOAD_LOC
2015-04-27 22:25:09 +02:00
"kitware@www.cmake.org:/projects/FTP/pub/cmake/${DIR}")
set(count 0)
foreach(file ${FILES})
if(NOT IS_DIRECTORY ${file})
message("upload ${file} ${UPLOAD_LOC}")
2013-03-16 19:13:01 +02:00
execute_process(COMMAND
scp ${file} ${UPLOAD_LOC}
2013-03-16 19:13:01 +02:00
RESULT_VARIABLE result)
if("${result}" GREATER 0)
message(FATAL_ERROR "failed to upload file to ${UPLOAD_LOC}")
2011-06-19 15:41:06 +03:00
endif()
2013-03-16 19:13:01 +02: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-19 15:41:06 +03:00
endif()
2013-03-16 19:13:01 +02:00
endforeach()
if(${count} EQUAL 0)
message(FATAL_ERROR "Error no files uploaded.")
2010-06-23 01:18:35 +03:00
endif()