CMake/Utilities/Release/upload_release.cmake

31 lines
804 B
CMake
Raw Normal View History

2006-10-16 20:47:07 +04:00
set(PROJECT_PREFIX cmake-)
if(NOT VERSION)
2009-11-06 00:09:31 +03:00
set(VERSION 2.8)
endif()
set(dir "v${VERSION}")
if("${VERSION}" MATCHES "master")
set(dir "dev")
endif()
2006-10-16 20:47:07 +04:00
file(GLOB FILES ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_PREFIX}*")
list(SORT FILES)
list(REVERSE FILES)
2006-10-16 20:47:07 +04:00
message("${FILES}")
set(UPLOAD_LOC
"kitware@www.cmake.org:/projects/FTP/pub/cmake/${dir}")
set(count 0)
2006-10-16 20:47:07 +04:00
foreach(file ${FILES})
if(NOT IS_DIRECTORY ${file})
message("upload ${file} ${UPLOAD_LOC}")
2006-10-16 20:47:07 +04:00
execute_process(COMMAND
scp ${file} ${UPLOAD_LOC}
RESULT_VARIABLE result)
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()
endif()
2006-10-16 20:47:07 +04:00
endforeach(file)
if(${count} EQUAL 0)
message(FATAL_ERROR "Error no files uploaded.")
endif()