upload_release.cmake 796 Bytes
Newer Older
Bill Hoffman's avatar
Bill Hoffman committed
1
set(PROJECT_PREFIX cmake-)
2
if(NOT VERSION)
Bill Hoffman's avatar
Bill Hoffman committed
3
 set(VERSION 2.8)
4
5
6
7
endif()
if("${VERSION}" MATCHES "master")
  set(VERSION CVS)
endif()
Bill Hoffman's avatar
Bill Hoffman committed
8
9
10
11
file(GLOB FILES ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_PREFIX}*")
message("${FILES}")
set(UPLOAD_LOC
  "kitware@www.cmake.org:/projects/FTP/pub/cmake/v${VERSION}")
12
set(count 0)
Bill Hoffman's avatar
Bill Hoffman committed
13
14
foreach(file ${FILES})
  if(NOT IS_DIRECTORY ${file})
15
    message("upload ${file} ${UPLOAD_LOC}")
Bill Hoffman's avatar
Bill Hoffman committed
16
17
18
    execute_process(COMMAND 
      scp ${file} ${UPLOAD_LOC}
      RESULT_VARIABLE result)  
19
    math(EXPR count "${count} + 1")
Bill Hoffman's avatar
Bill Hoffman committed
20
21
22
23
24
    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)
25
26
if(${count} EQUAL 0)
   message(FATAL_ERROR "Error no files uploaded.")
27
endif()