With make install
I can copy my binaries, configs etcetera to a target folder for execution.
Now I have the following situation: we have a virtual machine setup as a build host, and a different real Linux machine as a target platform.
I would like to have make install
copy the files directly in a folder on my remote machine (via scp
or similar). How can I achieve that?
You often could do
make install DESTDIR=/tmp/mydest/
then archive that destination directory
tar czvf /tmp/mydest.tgz -C /tmp mydest
then copy that archive to the remote place
scp /tmp/mydest.tgz remote:tmp/
at last, untar the archive at the remote and copy it at appropriate place
I am using this solution:
install (CODE "execute_process(COMMAND scp -r -i /home/user/.ssh/id_rsa ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/. user@remote:/path/to/copy/)")
Then I run command make install
and it's works
I know that ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} not best variable for it but for me it's fine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With