<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>As far as I am aware, the macOS linker simply records the install
name of the dynamic library you link against in your executable
(similar to how the Linux linker records the Elf SONAME, if
present). So, the first step would be to check the install name of
the external dynamic library by running 'otool -L' on it (the
install name should be at the top of the output). You can change
the install name using the install_name_tool (but if you build the
external dynamic library yourself I think it is better to build
the library with the correct install name in the first place).</p>
Am 24.09.19 um 18:02 schrieb Michael Welsh Duggan:<br>
<blockquote type="cite"
cite="mid:y2tdef8sqdfzt3.fsf@lx-birch.ad.sei.cmu.edu">
<pre class="moz-quote-pre" wrap="">I have a project that links against an external dynamic library for
which I have written a Find module that creates an import target. I do
this, in part, by setting the IMPORTED_LOCATION property of the target
to the location of the dynamic library.
Unfortunately, on OSX the library shows up in the executable load
commands as an LC_LOAD_DYLIB of the raw filename (no directory) of the
shared library. I expected it to use the whole path. I tried setting
the INSTALL_NAME_DIR property to the directory containing the shared
library, but this changed nothing.
I will note that this is all still in the build location, as opposed to
post-install. I am using the following settings currently:
set(CMAKE_SKIP_BUILD_RPATH false)
set(CMAKE_BUILD_WITH_INSTALL_RPATH false)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
set(CMAKE_MACOSX_RPATH true)
I'm not 100% confident with how these options interact, so I am more
than prepared for someone to tell me that I am doing something wrong.
Any hints would be appreciated.
</pre>
</blockquote>
<div class="moz-signature">-- <br>
<div style="width:480px; text-align: left; font-family: Arial,
Helvetica, sans-serif;">
<p style="color: #062d64; font-size: 14px; text-align: left;
font-family: Arial, Helvetica, sans-serif;">
<b>Dr. Eric Dönges</b>
<br>
Senior Software Engineer
</p>
<p style="color: #062d64; font-size: 12px; text-align: left;
font-family: Arial, Helvetica, sans-serif;">MVTec Software
GmbH | Arnulfstr. 205 | 80634 Munich | Germany
<br>
<a style="font-size: 12px; font-family: Arial, Helvetica,
sans-serif; color: #062d64;"
href="mailto:mustermann@mvtec.com">doenges@mvtec.com</a> |
Tel: +49 89 457 695-0 | <a style="font-size: 12px;
font-family: Arial, Helvetica, sans-serif; color: #062d64;"
href="http://www.mvtec.com">www.mvtec.com</a>
<br>
</p>
<p>
<span style="font-size: 12px; font-family: Arial, Helvetica,
sans-serif; color: #062d64;">Find our privacy policy <a
style="font-size: 12px; font-family: Arial, Helvetica,
sans-serif; color: #062d64;"
href="https://www.mvtec.com/imprint">here</a>.</span> </p>
<p style="color: #062d64; font-size: 12px; text-align: left;
font-family: Arial, Helvetica, sans-serif;"><img
src="https://mvtec.com/fileadmin/Redaktion/newsletter/mail-signature/newsletter-icon.png"
valign="bottom" width="16" height="16"> <a style="font-size:
12px; font-family: Arial, Helvetica, sans-serif; color:
#062d64; font-weight: bold;"
href="https://www.mvtec.com/newsletter">Sign up</a> for our
MVTec Newsletter!</p>
<p style="margin: 0px; color: #666; font-size: 12px; text-align:
left; font-family: Arial, Helvetica, sans-serif;">Geschäftsführer:
Dr. Wolfgang Eckstein, Dr. Olaf Munkelt<br>
Amtsgericht München HRB 114695</p>
<p style="margin: 0px; color: #666; font-size: 12px; text-align:
left; font-family: Arial, Helvetica, sans-serif;"> </p>
<img
src="https://www.mvtec.com/fileadmin/Redaktion/newsletter/mail-signature/mvtec-logo-line.png"
alt="MVTec Software GmbH Logo"></div>
</div>
</body>
</html>