1macro(cmd dir exe) 2 message("${exe} ${ARGN}") 3 execute_process( 4 COMMAND ${exe} ${ARGN} 5 WORKING_DIRECTORY ${dir} 6 OUTPUT_VARIABLE out 7 ERROR_VARIABLE out 8 RESULT_VARIABLE res 9 ) 10 message("${out}") 11 if(res) 12 message(FATAL_ERROR "Error running ${exe}") 13 else() 14 message("Success") 15 endif() 16endmacro() 17 18cmd(${WORKDIR} ln -snf ${CASEDIR} ${TGTCASEDIR}) 19if(DEFINED NUMSTART ) 20 cmd(${WORKDIR} cp ${NUMSTART} ${TGTCASEDIR}/numstart.dat) 21endif() 22cmd(${WORKDIR} ${MPIRUN} ${MPIRUN_PROCFLAG} ${NUMPROCS} ${EXE}) 23