On Wed, Nov 17, 2010 at 11:46 AM, David Doria &lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt; wrote:<br>&gt; On Wed, Nov 17, 2010 at 9:32 AM, Michael Jackson<br>&gt; &lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt; wrote:<br>
&gt;&gt; I tool a little different approach in my own projects. I end up<br>&gt;&gt; &quot;configuring&quot; a shell script that gets run at install time (OS X Only).<br>&gt;&gt; Inside that shell script are all the copying to the CMAKE_INSTALL_PREFIX,<br>
&gt;&gt; ensuring destination directories inside the OS X App bundle are setup<br>&gt;&gt; (Plugins, libs, Frameworks) and then finally calling the BundleUtilities to<br>&gt;&gt; copy all the dependent libraries and plugins into the App bundle and<br>
&gt;&gt; &quot;fixing&quot; the install_name embedded in each library so that they point to<br>&gt;&gt; libraries inside the bundle. For Qt projects I also make sure a blank<br>&gt;&gt; qt.conf file and qtmenu.nib file are properly copied into the bundle.<br>
&gt;&gt;<br>&gt;&gt;  There are some &quot;dark&quot; issues when it comes to plugins. The basic<br>&gt;&gt; BundleUtilities will look for files that end with .dylib (on OS X) and copy<br>&gt;&gt; those to the &quot;lib&quot; directory and frameworks into the Framework directory.<br>
&gt;&gt; The issue for me was when I had plugins with .dylib file extensions these<br>&gt;&gt; would always be copied into the wrong directory. I had to make sure I used a<br>&gt;&gt; set properties to set the file extension of my own plugins to .plugin so I<br>
&gt;&gt; had a guaranteed way to tell the difference between a support library that<br>&gt;&gt; should go into &quot;lib&quot; and a plugin that should get copied into Plugins. One<br>&gt;&gt; form of this can be found at<br>
&gt;&gt; &lt;<a href="http://scm.bluequartz.net/support-libraries/cmp/blobs/master/OSX_Tools/CompleteBundle.cmake.in">http://scm.bluequartz.net/support-libraries/cmp/blobs/master/OSX_Tools/CompleteBundle.cmake.in</a>&gt;<br>
&gt;&gt;  There may be some Qt specific lines in the file and it is OS X specific.<br>&gt;&gt; Also note that you can over-ride some of the BundleUtilities commands in<br>&gt;&gt; order to implement variations that suit your own needs.<br>
&gt;&gt;<br>&gt;&gt; ___________________________________________________________<br>&gt;&gt; Mike Jackson                      <a href="http://www.bluequartz.net">www.bluequartz.net</a><br>&gt;<br>&gt; David C. -<br>&gt;<br>
&gt; Is what Mike is doing here a work around or is this how<br>&gt; BundleUtilities is intended to be used?<br>&gt;<br>&gt; I was *hoping* for something more along the lines of simply:<br>&gt;<br>&gt; INSTALL(Qt)<br>&gt; INSTALL(VTK)<br>
&gt;<br>&gt; Those two lines would include everything necessary from Qt and VTK in<br>&gt; your project so you can hand someone without those tools your code and<br>&gt; it will run.<br>&gt;<br>&gt; Is this the goal and it is just not that easy (yet)? Or I am missing something?<br>
&gt;<br>&gt; David D.<br>&gt;<br><br><br>The goal is simply this:<br><br>- given:<br>  -- an executable target, that happens to be a bundle app on the Mac<br>  -- a full path to that bundle in the install tree<br>  -- a list of plugins that you have also already installed in the bundle<br>
  -- a list of directories where to find libraries that your executables and plugins depend on<br><br>that the following CMake code:<br><br>install(CODE &quot;<br>   include(BundleUtilities)<br>   fixup_bundle(\&quot;${YOUR_BUNDLE_PATH}\&quot; \&quot;\${YOUR_PLUGINS}\&quot; \&quot;${YOUR_LIBRARY_DIRS}\&quot;)<br>
   &quot; COMPONENT Runtime)<br><br>will do all the analysis and copying and fixing up of dependent libraries that is mechanically possible...<br><br>So that you do not even have to mention VTK and Qt to your install rules at all.<br>
<br>If you have to say anything about VTK or Qt beyond target_link_libraries, then BundleUtilities is a failure.<br><br><br>David C.<br><br>