# How to Install with saving Build RPATH ?

**URL:** <https://discourse.cmake.org/t/how-to-install-with-saving-build-rpath/3514>\
**Category:** Code\
**Tags:** os:linux\
**Created:** [June 7, 2021, 10:32am UTC](https://discourse.cmake.org/t/how-to-install-with-saving-build-rpath/3514 "2021-06-07T10:32:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artalus](https://discourse.cmake.org/user_avatar/discourse.cmake.org/artalus/32/1527_2.png) [@Artalus](https://discourse.cmake.org/u/Artalus)\
**Post date:** [June 7, 2021, 10:32am UTC](https://discourse.cmake.org/t/how-to-install-with-saving-build-rpath/3514/1 "2021-06-07T10:32:13Z")

</div>

Our current packaging process deeply relies on the fact that all the binaries and dependencies are being built into the same `/opt/stuff` directories that they will be placed into upon “installation”. Yes, I know that it sucks and is a bad practice.  
I was trying to start slowly and do not replace the process completely with `cmake --install` from scratch; just make it put everything into a single `install/` directory and then make old build scripts look for files in there.

However I cannot find any option to make cmake _do not touch RPATH at all_. By default cmake completely stripes any `/opt/stuff` links from the resulting binaries. If I use `INSTALL_RPATH_USE_LINK_PATH` it only adds some of the paths that should be there, but not all. There is `BUILD_WITH_INSTALL_RPATH`, but it is about reverse situation. Can I make Install basically copy files without any additional voodo - and without resorting to actually `install(CODE cp ...)`?
