Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / Release / upload_release.cmake
blobc7f99c086bd8495dd0f6522edc93ef812d0f8f90
1 set(PROJECT_PREFIX cmake-)
2 if(NOT VERSION)
3  set(VERSION 2.6)
4 endif(NOT VERSION)
5 file(GLOB FILES ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_PREFIX}*")
6 message("${FILES}")
7 set(UPLOAD_LOC
8   "kitware@www.cmake.org:/projects/FTP/pub/cmake/v${VERSION}")
9 set(count 0)
10 foreach(file ${FILES})
11   if(NOT IS_DIRECTORY ${file})
12     message("upload ${file} ${UPLOAD_LOC}")
13     execute_process(COMMAND 
14       scp ${file} ${UPLOAD_LOC}
15       RESULT_VARIABLE result)  
16     math(EXPR count "${count} + 1")
17     if("${result}" GREATER 0)
18       message(FATAL_ERROR "failed to upload file to ${UPLOAD_LOC}")
19     endif("${result}" GREATER 0)
20   endif(NOT IS_DIRECTORY ${file})
21 endforeach(file)
22 if(${count} EQUAL 0)
23    message(FATAL_ERROR "Error no files uploaded.")
24 endif(${count} EQUAL 0)