I’m running cmake 3.20.2 on Windows 10 and trying to call scp to copy an artefact to a remote machine after a successful build:
add_custom_command(
TARGET wdt_interrupt_gnu
POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O verilog $<TARGET_FILE:wdt_interrupt_gnu>
${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_NAME:wdt_interrupt_gnu>.vlg
COMMAND scp.exe ${CMAKE_CURRENT_BINARY_DIR}/wdt_interrupt_gnu.vlg <user name>@<remote path>
)
When running make that step fails:
process_begin: CreateProcess(NULL, scp.exe C:/<snip>/build/wdt_interrupt_gnu.vlg <user name>@<remote path>, ...) failed.
make (e=2): The system cannot find the file specified.
make[2]: *** [wdt_interrupt_gnu.axf] Error 2
make[2]: *** Deleting file `wdt_interrupt_gnu.axf'
make[1]: *** [CMakeFiles/wdt_interrupt_gnu.dir/all] Error 2
make: *** [all] Error 2
Any suggestions how to fix this please?