Use FILE(GLOB) to get a list of files first.<div>Don't recall if you can specify multiple files with scp, but if not, you can always use a foreach().</div><div><br></div><div>-Johan</div><div><br><br><div class="gmail_quote">
On Fri, Feb 11, 2011 at 11:28 AM, Mihai Sandu <span dir="ltr"><<a href="mailto:voyagersm@gmail.com">voyagersm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I want to upload multiple files and I think to do it with scp.<div><br></div><div>function (SSHUpload WORKDIR HOST USERNAME SOURCE DESTINATION)</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>find_program( SCP_PATH NAMES scp )</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>execute_process(WORKING_DIRECTORY ${WORKDIR}</div></blockquote>
<div> COMMAND ${SCP_PATH} ${SOURCE} ${USERNAME}@${HOST}:${DESTINATION} )</div><div>endfunction ()</div><div><br></div><div>And I call the function:</div><div><br></div><div>SSHUpload( "/home/user/tmp" "HOST" "USERNAME" "*" "DESTINATION" )</div>
<div><br></div><div>but I get the error: <span style="font-family:monospace;white-space:pre-wrap;font-size:medium">*: No such file or directory</span></div><div><span style="font-family:monospace;white-space:pre-wrap;font-size:medium"><br>
</span></div><div><span style="font-family:monospace;white-space:pre-wrap;font-size:medium">There is another way? Or where I'm wrong?</span></div><div><span style="font-family:monospace;white-space:pre-wrap;font-size:medium"><br>
</span></div><div><span style="font-family:monospace;white-space:pre-wrap;font-size:medium">PS: I tried also with scp -r but it take the folder, and I want only the files from folder.</span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>