2006-10-16 20:47:07 +04:00
|
|
|
set(PROJECT_PREFIX cmake-)
|
2007-09-10 18:49:05 +04:00
|
|
|
if(NOT VERSION)
|
|
|
|
set(VERSION 2.4)
|
|
|
|
endif(NOT VERSION)
|
2006-10-16 20:47:07 +04:00
|
|
|
file(GLOB FILES ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_PREFIX}*")
|
|
|
|
message("${FILES}")
|
|
|
|
set(UPLOAD_LOC
|
|
|
|
"kitware@www.cmake.org:/projects/FTP/pub/cmake/v${VERSION}")
|
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}")
|
2006-10-16 20:47:07 +04:00
|
|
|
execute_process(COMMAND
|
|
|
|
scp ${file} ${UPLOAD_LOC}
|
|
|
|
RESULT_VARIABLE result)
|
2007-09-10 18:49:05 +04:00
|
|
|
math(EXPR count "${count} + 1")
|
2006-10-16 20:47:07 +04:00
|
|
|
if("${result}" GREATER 0)
|
|
|
|
message(FATAL_ERROR "failed to upload file to ${UPLOAD_LOC}")
|
|
|
|
endif("${result}" GREATER 0)
|
|
|
|
endif(NOT IS_DIRECTORY ${file})
|
|
|
|
endforeach(file)
|
2007-09-10 18:49:05 +04:00
|
|
|
if(${count} EQUAL 0)
|
|
|
|
message(FATAL_ERROR "Error no files uploaded.")
|
|
|
|
endif(${count} EQUAL 0)
|