<div dir="ltr">Perhaps the <a href="https://cmake.org/cmake/help/latest/prop_tgt/BUILD_RPATH.html">BUILD_RPATH</a> and <a href="https://cmake.org/cmake/help/latest/prop_tgt/INSTALL_RPATH.html">INSTALL_RPATH</a> target properties are (at least partially) what you are looking for? There are also other associated properties and variables, just search the CMake docs for RPATH to see the full set.<div><br></div><div>You still have to handle differences between Apple platforms and other unix derivatives, but that's typically a manageably small set of differences.</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 15, 2018 at 4:06 AM Rob Boehne <<a href="mailto:robb@datalogics.com">robb@datalogics.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_8136074170655727721WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">All,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’m switching to CMake for a complex project that supports many operating systems, and consists of C++ shared libraries and plugins.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I tend to use ${ORIGIN} (in Linux/Solaris parlance) and -z defs at library creation time to support relative hard-coded library lookup paths and prevent problems with unresolved symbols (respectively).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Both of these translate into many different flags for different compilers and linkers, and I was curious if there were facilities in CMake for handling this, or a home-grown module that can take care of that
for me.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Rob<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<table class="m_8136074170655727721MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="392" style="width:293.8pt;border-collapse:collapse">
<tbody>
<tr style="height:66.75pt">
<td width="101" style="width:76.0pt;padding:0in 5.4pt 0in 5.4pt;height:66.75pt">
<p class="MsoNormal" align="center" style="text-align:center;text-autospace:none">
<span style="font-size:11.0pt"><img width="87" height="87" style="width:.9062in;height:.9062in" id="m_8136074170655727721Picture_x0020_1" src="cid:image001.png@01D44C3C.6D551BF0" alt="cid:image002.png@01D3D0E3.DCFE6710"><u></u><u></u></span></p>
</td>
<td width="290" style="width:217.8pt;padding:0in 5.4pt 0in 5.4pt;height:66.75pt">
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#e83c21">Rob Boehne</span></b><span style="font-size:11.0pt"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Senior Software Architect | Datalogics, Inc.</span><span style="font-size:11.0pt"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt"><a href="tel:(312)%20853-8351" target="_blank"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0b4cb4">+1.312.853.8351</span></a></span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> | <a href="mailto:robb@datalogics.com" target="_blank"><span style="color:#0b4cb4">robb@datalogics.com</span></a></span><span style="font-size:11.0pt"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:11.0pt"><a href="http://www.datalogics.com/" target="_blank"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0b4cb4">datalogics.com</span></a></span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> | <a href="http://blogs.datalogics.com/" target="_blank"><span style="color:#0b4cb4">blogs.datalogics.com</span></a></span><span style="font-size:11.0pt"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Connect with us: <a href="https://www.facebook.com/DatalogicsInc" target="_blank"><span style="color:#0b4cb4">Facebook</span></a> | <a href="https://twitter.com/DatalogicsInc" target="_blank"><span style="color:#0b4cb4">Twitter</span></a> | <a href="https://www.linkedin.com/company/datalogics?actionToken=p=p%3Dbiz-company-login%26c%3D3217e65a-bdc2-4b38-8f9c-13c982e8c529%26m%3Dcompany_feed%26n%3D0&t=a%3DisFolloweeOfPoster%253Dfalse%2526distanceFromActor%253D-1%2526actorType%253D%2526likedByUser%253Dfalse%2526targetId%253D%2526recentCommentUrns%253D%2526targetType%253D%2526sponsoredFlag%253DORGANIC%2526verbType%253Dlinkedin%25253Ashare%2526objectType%253Dlinkedin%25253Aarticle%2526totalShares%253D0%2526activityId%253Durn%25253Ali%25253Aactivity%25253A6263731876121362433%2526recentLikerUrns%253D%2526actorId%253Durn%25253Ali%25253Acompany%25253A14000%2526totalComments%253D0%2526relevanceScore%253D0.0%2526recentCommenterUrns%253D%2526isPublic%253Dtrue%2526time%253D-1%2526totalLikes%253D0%2526objectId%253Durn%25253Ali%25253Aarticle%25253A7793179909183391510%2526distanceFromNestedActor%253D-1%26s%3DORG" target="_blank"><span style="color:#0b4cb4">LinkedIn</span></a> | <a href="https://www.youtube.com/user/Datalogics" target="_blank"><span style="color:#0b4cb4">YouTube</span></a></span><span style="font-size:11.0pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"> </span><span style="font-size:11.0pt"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><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>New book released: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div>