# use scp command send some file to another linux board

**URL:** https://discourse.cmake.org/t/use-scp-command-send-some-file-to-another-linux-board/4703
**Category:** Usage
**Tags:** os:linux
**Created:** [December 18, 2021, 6:02am UTC](https://discourse.cmake.org/t/use-scp-command-send-some-file-to-another-linux-board/4703 "2021-12-18T06:02:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lichunfei](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@lichunfei](https://discourse.cmake.org/u/lichunfei)
#### Post date: [December 18, 2021, 6:02am UTC](https://discourse.cmake.org/t/use-scp-command-send-some-file-to-another-linux-board/4703/1 "2021-12-18T06:02:09Z")

</div>

to generate makefile this function:make upload  
upload:  
scp filename [orangepi@192.168.8.105](mailto:orangepi@192.168.8.105):/home/orangepi/sgai

how should I code my cmakefile?  
set(output “filename”)  
set(destination [orangepi@192.168.8.105](mailto:orangepi@192.168.8.105):/home/orangepi/sgai)  
add\_custom\_command(  
DEPENDS “${target}”  
OUTPUT “${output}”  
COMMAND scp “$\<TARGET\_FILE:${target}\>” “${destination}”  
COMMAND “${CMAKE\_COMMAND}” -E touch “${output}”)  
add\_custom\_target(“upload” DEPENDS “${output}”)

please correct my code,thanks!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 21, 2021, 12:17pm UTC](https://discourse.cmake.org/t/use-scp-command-send-some-file-to-another-linux-board/4703/2 "2021-12-21T12:17:00Z")

</div>

This looks fine to me. What behavior are you seeing that this is not working?

---

<div class="post-metadata">

### Author: ![lichunfei](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@lichunfei](https://discourse.cmake.org/u/lichunfei)
#### Post date: [December 22, 2021, 12:47am UTC](https://discourse.cmake.org/t/use-scp-command-send-some-file-to-another-linux-board/4703/3 "2021-12-22T00:47:14Z")

</div>

thanks，this question already solved；
