<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Hi<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>There a wiki page covering this<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><a href="https://cmake.org/Wiki/CMake_RPATH_handling">https://cmake.org/Wiki/CMake_RPATH_handling</a><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I find it a bit confusing (and the example code for the “full RPATH” option seems to set CMAKE_INSTALL_RPATH twice), but it should help. <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>It might be outdated for OSX as El Capitan introduced extra security requirements such that the recommendations on the wiki no longer seem to work. You can see some of our struggles with this here<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><a href="https://github.com/CCPPETMR/SIRF/pull/79">https://github.com/CCPPETMR/SIRF/pull/79</a><o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>We seem to have found a solution using CMAKE_INSTALL_NAME_DIR but any other help with that appreciated.<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='mso-fareast-language:EN-US'>Kris<o:p></o:p></span></a></p><span style='mso-bookmark:_MailEndCompose'></span><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> CMake [mailto:cmake-bounces@cmake.org] <b>On Behalf Of </b>Franck Houssen<br><b>Sent:</b> 01 February 2018 09:46<br><b>To:</b> CMake Mail List <cmake@cmake.org><br><b>Subject:</b> Re: [CMake] How to get RPATH option (-Wl, -rpath, /path/to/local/lib) ?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:black'>OK, so I believe I just need to write "-Wl,rpath" in my templates of pc/cmake files !...<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:black'>Franck<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:black'><o:p> </o:p></span></p></div><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:black'><hr size=5 width="100%" align=center id=zwchr></span></div><blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><b><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>De: </span></b><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>"Franck Houssen" <<a href="mailto:franck.houssen@inria.fr">franck.houssen@inria.fr</a>><br><b>À: </b>"CMake Mail List" <<a href="mailto:cmake@cmake.org">cmake@cmake.org</a>><br><b>Envoyé: </b>Mercredi 31 Janvier 2018 10:39:51<br><b>Objet: </b>[CMake] How to get RPATH option (-Wl,-rpath,/path/to/local/lib) ?<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p></div><div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>How to get RPATH option (-Wl,-rpath,/path/to/local/lib) ?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>I would like to create a *.pc/cmake file for users to find a library I provide. As there is possibly a LOT of dependencies (libraries) I may not even be able to list, the most simple way to do that is to use RPATH. I know that for gcc, RPATH is set with "-Wl,-rpath". But what about others compilers (pgi, icc) ? This option could not be the same.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>Is it possible to "grab" the correct RPATH option (-Wl,-rpath) according to the compiler ? Something like a CMAKE_RPATH_OPTIONS to substitute in a *.pc/cmake.in template file ? (to create a *.pc/cmake file in the install directory using configure_file)<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif;color:black'>Franck<o:p></o:p></span></p></div></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><br>-- <o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Powered by <a href="http://www.kitware.com">www.kitware.com</a><o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Kitware offers various services to support the CMake community. For more information on each offering, please visit:<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>CMake Support: <a href="http://cmake.org/cmake/help/support.html">http://cmake.org/cmake/help/support.html</a><br>CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/consulting.html</a><br>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html">http://cmake.org/cmake/help/training.html</a><o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Follow this link to subscribe/unsubscribe:<br><a href="https://cmake.org/mailman/listinfo/cmake">https://cmake.org/mailman/listinfo/cmake</a><o:p></o:p></span></p></blockquote><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:black'><o:p> </o:p></span></p></div></div></div></body></html>