<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=utf-8"><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:"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:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>You need to pass in more paths to the “fixup_bundle()” method. Those paths are the paths where the libraries are located so CMake has somewhere else to look in case the absolute path is not encoded in the dylib itself. I could point you to our project but it is pretty scary in there. We use a custom generated CMake script that does a bunch of extra stuff that Qt requires (qt.conf) and stuff like that. Does work reliably for use once we got it setup.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="https://github.com/BlueQuartzSoftware/CMP/tree/develop/OSX_Tools">https://github.com/BlueQuartzSoftware/CMP/tree/develop/OSX_Tools</a><o:p></o:p></p><p class=MsoNormal><a href="https://github.com/BlueQuartzSoftware/CMP/blob/develop/OSX_Tools/CompleteBundle.cmake.in">https://github.com/BlueQuartzSoftware/CMP/blob/develop/OSX_Tools/CompleteBundle.cmake.in</a><o:p></o:p></p><p class=MsoNormal><a href="https://github.com/BlueQuartzSoftware/CMP/blob/develop/OSX_Tools/MacOSXBundleInfo.plist.in">https://github.com/BlueQuartzSoftware/CMP/blob/develop/OSX_Tools/MacOSXBundleInfo.plist.in</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>They probably are not an “exemplar” of how to do things as they were created when CMake 3.1 was new so there are probably better ways to get the same thing done but this works in our environment. I have a whole separate bash script that lets us create a signed .dmg file.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>--<o:p></o:p></p><p class=MsoNormal>Mike Jackson<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal style='margin-left:.5in'>On 7/19/18, 2:04 PM, "CMake on behalf of Harry Mallon" <<a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> on behalf of <a href="mailto:Harry.Mallon@codex.online">Harry.Mallon@codex.online</a>> wrote:<o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p></div><p class=MsoNormal style='margin-left:.5in'>Hi,<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>I have been messing arounds with fixup_bundle (which seems to be the correct function). It worked for a small test case, but only if the dylibs required had otool ids of their full path. Ours currently have rpath based ones (e.g. @rpath/libcrypto.dylib). So I get a lot of:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: '@rpath/ libcrypto.dylib’: No such file or directory <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Hmm, seems like the stuff is there somewhere to make this work…<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Best,<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Harry<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> <o:p></o:p></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-left:1.0in'><b><span style='font-size:12.0pt;color:black'>From: </span></b><span style='font-size:12.0pt;color:black'>Stephen McDowell <sjm324@cornell.edu><br><b>Date: </b>Thursday, 19 July 2018 at 17:35<br><b>To: </b>Harry Mallon <Harry.Mallon@codex.online><br><b>Cc: </b>CMake MailingList <cmake@cmake.org><br><b>Subject: </b>Re: [CMake] Packaging dylibs into app bundles</span><o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'>Hi Harry, <o:p></o:p></p><div><p class=MsoNormal style='margin-left:1.0in'> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'>I don't know how useful this will be, but the Instant Meshes application creates an app bundle that has always worked reliably for me. Looking at the code, it doesn't appear like there's much custom stuff going on either. It starts here<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'><a href="https://github.com/wjakob/instant-meshes/blob/011fa44ab72037cbc16535090a63ead41963c1e5/CMakeLists.txt#L151">https://github.com/wjakob/instant-meshes/blob/011fa44ab72037cbc16535090a63ead41963c1e5/CMakeLists.txt#L151</a><o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'>And there's an if APPLE block below that appears to be the core.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'>Hope that is useful :) I've never actually done this for any of my own projects though. And I'm pretty sure them setting the underlying GUI library and TBB to be static (as opposed to shared) is skirting around the issue that you are trying to solve (dylib stuff)...<o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'> <o:p></o:p></p></div><div><p class=MsoNormal style='margin-left:1.0in'>-Stephen<o:p></o:p></p></div></div><p class=MsoNormal style='margin-left:1.0in'> <o:p></o:p></p><div><div><p class=MsoNormal style='margin-left:1.0in'>On Thu, Jul 19, 2018, 9:03 AM Harry Mallon <Harry.Mallon@codex.online> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in'>Hello all,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in'>Is there a good tutorial/article on getting CMake to package required dylibs and frameworks into an app bundle for you on mac. We have a lot of custom stuff to do it and it is fragile and breaks a lot.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in'>Thanks,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:1.0in'>Harry<o:p></o:p></p></div><p style='mso-margin-top-alt:7.5pt;margin-right:0in;margin-bottom:1.5pt;margin-left:1.0in;line-height:12.0pt' id="m_2507027356817711930c1-id-6"><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'>Harry Mallon</span><o:p></o:p></p><p style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:7.5pt;margin-left:1.0in;line-height:12.0pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:gray'>Senior Software Engineer</span><o:p></o:p></p><p style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:7.5pt;margin-left:1.0in;line-height:12.0pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'><a href="https://codex.online/" title=""Visit our website" t "><span style='color:black;text-decoration:none'><span style='color:blue;border:solid windowtext 1.0pt;padding:0in'><img border=0 width=32 height=32 style='width:.3333in;height:.3333in' id="_x0000_i1026" src="cid:~WRD000.jpg" alt="Image removed by sender."></span></span></a></span><o:p></o:p></p><p style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:3.0pt;margin-left:1.0in;line-height:12.0pt' id="m_2507027356817711930c1-id-14"><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:black'>T</span><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:gray'> <a href="callto:+44%20203%207000%20989" target="_blank"><span style='color:gray;text-decoration:none'>+44 203 7000 989</span></a> </span><o:p></o:p></p><p style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:7.5pt;margin-left:1.0in;line-height:12.0pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:gray'>60 Poland Street | London | England | W1F 7NT </span><o:p></o:p></p><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=385 style='width:288.75pt;margin-left:1.0in;border-collapse:collapse;OUTLINE-WIDTH:0px;OUTLINE-STYLE:none;OUTLINE-COLOR:invert'><tr><td colspan=3 style='border:none;border-top:solid gray 1.0pt;padding:0in 0in 0in 0in'><p class=MsoNormal style='margin-top:10.5pt'><span style='border:solid windowtext 1.0pt;padding:0in'><img border=0 width=32 height=32 style='width:.3333in;height:.3333in' id="_x0000_i1025" src="cid:~WRD000.jpg" alt="Image removed by sender."></span><o:p></o:p></p></td></tr><tr><td width=125 style='width:93.75pt;padding:0in 0in 0in 0in'><p class=MsoNormal style='line-height:11.0pt'><span style='font-size:6.5pt;font-family:"Arial",sans-serif;color:gray'>Three Billboards</span><o:p></o:p></p></td><td width=131 style='width:98.25pt;padding:0in 0in 0in 0in'><p class=MsoNormal style='line-height:11.0pt'><span style='font-size:6.5pt;font-family:"Arial",sans-serif;color:gray'>Blade Runner 2049 </span><o:p></o:p></p></td><td width=129 style='width:96.75pt;padding:0in 0in 0in 0in'><p class=MsoNormal style='line-height:11.0pt'><span style='font-size:6.5pt;font-family:"Arial",sans-serif;color:gray'> I, Tonya</span><o:p></o:p></p></td></tr></table><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:1.0in'> <o:p></o:p></p></div><p class=MsoNormal style='margin-left:1.0in'>-- <br><br>Powered by <a href="http://www.kitware.com" 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" 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" target="_blank">http://cmake.org/cmake/help/support.html</a><br>CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" 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" 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" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><o:p></o:p></p></blockquote></div><p class=MsoNormal style='margin-left:.5in'>-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake <o:p></o:p></p></div></body></html>