<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019 at 5:24 PM Zakrzewski, Jakub <<a href="mailto:Jakub.Zakrzewski@scheer-group.com">Jakub.Zakrzewski@scheer-group.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
________________________________________<br>
From: CMake <<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a>> on behalf of DIXON, MARK C. <<a href="mailto:mark.c.dixon@durham.ac.uk" target="_blank">mark.c.dixon@durham.ac.uk</a>><br>
Sent: 08 October 2019 17:25<br>
To: <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
Subject: [CMake] cmake end user vs. developer rpath handling<br>
<br>
>Sometimes, this does the trick. When it does, I'm very happy:<br>
><br>
> cmake -D CMAKE_INSTALL_RPATH="/my/rpath" source_dir<br>
><br>
>I'm currently looking at a package<br>
>(<a href="https://github.com/PointCloudLibrary/pcl" rel="noreferrer" target="_blank">https://github.com/PointCloudLibrary/pcl</a>) where this has no bearing on<br>
>the rpath of the installed software - I seem to get something set by the<br>
>developer.<br>
<br>
That "something" seems to be line 257:<br>
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")<br>
<br>
>Is there a way to reliably add to, or at least override, the developer's<br>
>rpath in any cmake-built software?<br>
<br>
<br>
Short of editing the build system scripts? I doubt...<br>
</blockquote></div><div><br></div>The CMAKE_INSTALL_RPATH variable is used to initialise the INSTALL_RPATH property of a target when that target is created. If you are pulling in these other projects via add_subdirectory() rather than building them standalone, you could modify the INSTALL_RPATH property of the targets you want to change from within your own top level project after add_subdirectory() returns.<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>Get the hand-book for every CMake user: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div><div>Consulting services (CMake, C++, build/release processes): <a href="https://crascit.com/services" target="_blank">https://crascit.com/services</a></div></div></div></div></div></div></div></div></div></div></div></div>