<div dir="ltr">So I noticed the CMAKE_MACOSX_RPATH variable, and tried setting it, which does result in the install name of the dylib being set to @rpath/dylibname.so BUT when I link it in an executable tool -L just shows the dylib as @rpath/dylibname.so and the linker fails to find it at run time. What is the proper way to get CMake to build the executable linking against the dylib and be able to run it in the build tree and install tree?</div>
<div class="gmail_extra"><br clear="all"><div>Izaak Beekman<br>===================================<br>(301)244-9367<br>UMD-CP Visiting Graduate Student<br>Aerospace Engineering<br><a href="mailto:ibeekman@umiacs.umd.edu" target="_blank">ibeekman@umiacs.umd.edu</a><br>
<a href="mailto:ibeekman@umd.edu" target="_blank">ibeekman@umd.edu</a></div>
<br><br><div class="gmail_quote">On Sat, May 3, 2014 at 10:54 AM, Dan Kegel <span dir="ltr"><<a href="mailto:dank@kegel.com" target="_blank">dank@kegel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On Sat, May 3, 2014 at 7:17 AM, <<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>> wrote:<br>
> Use at least CMake 2.8.12 and in your library project add this:<br>
> set(CMAKE_MACOSX_RPATH 1)<br>
</div>> ...<br>
<div class="">> For more details:<br>
> <a href="http://www.kitware.com/blog/home/post/510" target="_blank">http://www.kitware.com/blog/home/post/510</a><br>
<br>
</div>What he said. See also past discussion at<br>
<a href="http://web.archiveorange.com/archive/v/5y7PkspCBZwiWhvodZSP" target="_blank">http://web.archiveorange.com/archive/v/5y7PkspCBZwiWhvodZSP</a><br>
I put together some tiny demos showing various ways to do it, with<br>
walkthroughs, at<br>
<a href="http://kegel.com/macosx/rpath/" target="_blank">http://kegel.com/macosx/rpath/</a><br>
</blockquote></div><br></div>