Yes, it&#39;s possible. But I would only advise it if you do it on a per-framework basis, you built &amp; installed it yourself, and you know for certain that the framework in question works fine when moved from its &quot;/System/Library&quot; location.<div>
<br></div><div>Is this an OpenCL that you built yourself, or did it come from some package manager?<br><br></div><div>The set of &quot;type&quot; values that GetPrerequisites assigns to files are:</div><div><div>  set(type &quot;system&quot;)</div>
<div>  set(type &quot;embedded&quot;)</div><div>  set(type &quot;local&quot;)</div><div><div>  set(type &quot;other&quot;)</div></div><div><br></div><div>&quot;system&quot; means never copy, never fixup</div><div>&quot;embedded&quot; means it will be inside the app bundle, and may be addressed relative to @executable_path after fixup_bundle is done</div>
<div>&quot;local&quot; means it is in exactly the same directory as the executable</div><div>&quot;other&quot; is everything else</div><div><br></div><div>So, in your case, you&#39;d want to match on the file path beginning and set the type to &quot;other&quot;. Just add another chunk inside your override function that looks like this:</div>
<div><br></div><div><span class="Apple-style-span">     if(resolved_file MATCHES &quot;^/</span>System/Library/Frameworks/OpenCL.framework<span class="Apple-style-span">&quot;)<br>       message(&quot;resolving ${resolved_file} as other&quot;)<br>
       set(${type_var} other PARENT_SCOPE)<br>     endif()<br></span></div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br></div><div class="gmail_quote">On Mon, May 21, 2012 at 4:01 PM, Joe Ping-Lin Hsiao <span dir="ltr">&lt;<a href="mailto:phsiao@cs.unc.edu" target="_blank">phsiao@cs.unc.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, David. It works!<br>
<br>
Is it possible to do the other way around?<br>
I want fixup_bundle() to treat<br>
/System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libclparser.dylib<br>
as an external library instead of a system lib. I looked at functions<br>
in BundleUtilities.cmake and GetPrerequisites.cmake but didn&#39;t get any<br>
clue how to do that.<br>
<br>
Thanks,<br>
Joe<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, May 14, 2012 at 8:47 PM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt; Rather than just doing a &quot;fixup_bundle&quot; as an INSTALL(CODE snippet, put it<br>
&gt; in a separate CMake script, and use install(SCRIPT to execute it. You can<br>
&gt; configure the script with configure_file if you need to put stuff in it that<br>
&gt; depends on CMake variables.<br>
&gt;<br>
&gt; Then, in your script:<br>
&gt;<br>
&gt;   # Define the function before including BundleUtilities:<br>
&gt;   function(gp_resolved_file_type_override resolved_file type_var)<br>
&gt;     if(resolved_file MATCHES &quot;^/usr/X11/lib&quot;)<br>
&gt;       message(&quot;resolving ${resolved_file} as system&quot;)<br>
&gt;       set(${type_var} system PARENT_SCOPE)<br>
&gt;     endif()<br>
&gt;   endfunction()<br>
&gt;<br>
&gt;   include(BundleUtilities)<br>
&gt;<br>
&gt;   fixup_bundle( ... )<br>
&gt;<br>
&gt; ParaView&#39;s install rules on the Mac do something like this, if you want to<br>
&gt; look at some example code.<br>
&gt;<br>
&gt;<br>
&gt; HTH,<br>
&gt; David<br>
&gt;<br>
&gt;<br>
&gt; On Mon, May 14, 2012 at 5:27 PM, Joe Ping-Lin Hsiao &lt;<a href="mailto:phsiao@cs.unc.edu">phsiao@cs.unc.edu</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Thanks, this is exactly what I need.<br>
&gt;&gt;<br>
&gt;&gt; Just one question.  Why the function gp_resolved_file_type_override()<br>
&gt;&gt; cannot be seen if it is implemented in my project&#39;s CMakeLists.txt? I<br>
&gt;&gt; have to add it in GetPrerequisite.cmake module, but that&#39;s not good.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Joe<br>
&gt;&gt;<br>
&gt;&gt; On Mon, May 7, 2012 at 11:04 AM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; /usr/X11/lib/libglut.dylib should probably be considered a &quot;system<br>
&gt;&gt; &gt; library&quot; that is not included in your final bundle.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Therefore, all users of your application will have to have the Mac OS<br>
&gt;&gt; &gt; X version of X installed and available in order to run your program.<br>
&gt;&gt; &gt; (Is that all Macs nowadays anyway...?)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; In order to classify it as a system library, you can provide a CMake<br>
&gt;&gt; &gt; function named gp_resolved_file_type_override to look for that library<br>
&gt;&gt; &gt; (probably anything starting with &quot;/usr/X11/lib&quot;) and set its type to<br>
&gt;&gt; &gt; &quot;system&quot; -- that will cause fixup_bundle to ignore it for copying and<br>
&gt;&gt; &gt; fixup purposes.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; HTH,<br>
&gt;&gt; &gt; David<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Mon, May 7, 2012 at 10:57 AM, Joe Ping-Lin Hsiao &lt;<a href="mailto:phsiao@cs.unc.edu">phsiao@cs.unc.edu</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I use CMake to create an installer for a Mac program which uses GLUT.<br>
&gt;&gt; &gt;&gt; The GLUT library that the program links against with is<br>
&gt;&gt; &gt;&gt; /usr/X11/lib/libglut.dylib.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; When I use fixup_bundle() to create an installer, I get the following<br>
&gt;&gt; &gt;&gt; error message:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; install_name_tool: changing install names or rpaths can&#39;t be redone<br>
&gt;&gt; &gt;&gt; for:<br>
&gt;&gt; &gt;&gt; /Users/phsiao/dev/video/video_spot_tracker.app/Contents/MacOS/libglut.3.dylib<br>
&gt;&gt; &gt;&gt; (for architecture ppc7400) because larger updated load commands do not<br>
&gt;&gt; &gt;&gt; fit (the program must be relinked, and you may need to use -headerpad<br>
&gt;&gt; &gt;&gt; or -headerpad_max_install_names)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The first thing I tried was to add -headerpad_max_install_names and<br>
&gt;&gt; &gt;&gt; -headerpad to the linker flags, but no success. (Actually<br>
&gt;&gt; &gt;&gt; -headerpad_max_install_names already exists in CMakeFies/link.txt<br>
&gt;&gt; &gt;&gt; before I put it in.)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The next thing I tried was to add &#39;-arch x86_64&#39; to both CXX_FLAGS and<br>
&gt;&gt; &gt;&gt; LINKER_FLAGS to avoid fixup_bundle() to fix dependencies for<br>
&gt;&gt; &gt;&gt; architecture ppc7400, but the error remains.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Any idea how to get around this?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Thanks,<br>
&gt;&gt; &gt;&gt; Joe<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt; &gt;&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt;&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>