Utilities/Release: Add optional remote launcher to ssh calls

This commit is contained in:
Brad King 2015-12-10 14:57:22 -05:00
parent a53e0168c3
commit a95b47154e
1 changed files with 7 additions and 4 deletions

View File

@ -19,6 +19,9 @@ endif()
if(NOT DEFINED RUN_SHELL)
set(RUN_SHELL "/bin/sh")
endif()
if(NOT DEFINED RUN_LAUNCHER)
set(RUN_LAUNCHER "")
endif()
if(NOT DEFINED PROCESSORS)
set(PROCESSORS 1)
endif()
@ -52,11 +55,11 @@ message("Creating CMake release ${CMAKE_CREATE_VERSION} on ${HOST} with parallel
macro(remote_command comment command)
message("${comment}")
if(${ARGC} GREATER 2)
message("ssh ${HOST} ${command}")
execute_process(COMMAND ssh ${HOST} ${command} RESULT_VARIABLE result INPUT_FILE ${ARGV2})
message("ssh ${HOST} ${RUN_LAUNCHER} ${command}")
execute_process(COMMAND ssh ${HOST} ${RUN_LAUNCHER} ${command} RESULT_VARIABLE result INPUT_FILE ${ARGV2})
else()
message("ssh ${HOST} ${command}")
execute_process(COMMAND ssh ${HOST} ${command} RESULT_VARIABLE result)
message("ssh ${HOST} ${RUN_LAUNCHER} ${command}")
execute_process(COMMAND ssh ${HOST} ${RUN_LAUNCHER} ${command} RESULT_VARIABLE result)
endif()
if(${result} GREATER 0)
message(FATAL_ERROR "Error running command: ${command}, return value = ${result}")