[CMake] upload multiple files

Johan Björk phb at spotify.com
Fri Feb 11 06:29:27 EST 2011


Use FILE(GLOB) to get a list of files first.
Don't recall if you can specify multiple files with scp, but if not, you can
always use a foreach().

-Johan


On Fri, Feb 11, 2011 at 11:28 AM, Mihai Sandu <voyagersm at gmail.com> wrote:

> I want to upload multiple files and I think to do it with scp.
>
> function (SSHUpload WORKDIR HOST USERNAME SOURCE DESTINATION)
>
> find_program( SCP_PATH NAMES scp )
>
> execute_process(WORKING_DIRECTORY ${WORKDIR}
>
>                           COMMAND ${SCP_PATH} ${SOURCE} ${USERNAME}@${HOST}:${DESTINATION}
> )
> endfunction ()
>
> And I call the function:
>
> SSHUpload( "/home/user/tmp"  "HOST" "USERNAME" "*" "DESTINATION" )
>
> but I get the error: *: No such file or directory
>
> There is another way? Or where I'm wrong?
>
> PS: I tried also with scp -r but it take the folder, and I want only the
> files from folder.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110211/35695d6e/attachment.htm>


More information about the CMake mailing list