How to install a file set on remote target using cmake?

已回答

Hello everyone,

I tried using install() and that did nothing to copy a set of support files onto the remote target. Is that the wrong cmake command for doing that.

 

It does not even install it locally. 

install(FILES support_files/builder.ui DESTINATION /*********/cmake-build-debug/)

 

Something appears to be very wrong with this, just inserted a nonsense file name for the source file that is not in the project and reloaded the cmake project and it will build without any errors. What is up with that?

 

1

Hello!

Regarding the “copy locally” case:

Please note that the install() command is executed only when you run the install step. In CLion, you can do that using the Build | Install action from the main menu (see https://www.jetbrains.com/help/clion/using-cmake-install.html).

Just in case, if you want to copy a file at configure time, you can use file(COPY).

Regarding the “copy to the remote machine” case:

You can use the add_custom_command() command for that (see https://stackoverflow.com/a/33919175).

1

Thank you very much for being so very helpful and accurate. file(COPY) worked perfectly to get the files on the remote board and locally.

0

请先登录再写评论。