On Wed, Nov 17, 2010 at 11:46 AM, David Doria <daviddo...@gmail.com> wrote:
> On Wed, Nov 17, 2010 at 9:32 AM, Michael Jackson
> <mike.jack...@bluequartz.net> wrote:
>> I tool a little different approach in my own projects. I end up
>> "configuring" a shell script that gets run at install time (OS X Only).
>> Inside that shell script are all the copying to the CMAKE_INSTALL_PREFIX,
>> ensuring destination directories inside the OS X App bundle are setup
>> (Plugins, libs, Frameworks) and then finally calling the BundleUtilities
to
>> copy all the dependent libraries and plugins into the App bundle and
>> "fixing" the install_name embedded in each library so that they point to
>> libraries inside the bundle. For Qt projects I also make sure a blank
>> qt.conf file and qtmenu.nib file are properly copied into the bundle.
>>
>>  There are some "dark" issues when it comes to plugins. The basic
>> BundleUtilities will look for files that end with .dylib (on OS X) and
copy
>> those to the "lib" directory and frameworks into the Framework directory.
>> The issue for me was when I had plugins with .dylib file extensions these
>> would always be copied into the wrong directory. I had to make sure I
used a
>> set properties to set the file extension of my own plugins to .plugin so
I
>> had a guaranteed way to tell the difference between a support library
that
>> should go into "lib" and a plugin that should get copied into Plugins.
One
>> form of this can be found at
>> <
http://scm.bluequartz.net/support-libraries/cmp/blobs/master/OSX_Tools/CompleteBundle.cmake.in
>
>>  There may be some Qt specific lines in the file and it is OS X specific.
>> Also note that you can over-ride some of the BundleUtilities commands in
>> order to implement variations that suit your own needs.
>>
>> ___________________________________________________________
>> Mike Jackson                      www.bluequartz.net
>
> David C. -
>
> Is what Mike is doing here a work around or is this how
> BundleUtilities is intended to be used?
>
> I was *hoping* for something more along the lines of simply:
>
> INSTALL(Qt)
> INSTALL(VTK)
>
> Those two lines would include everything necessary from Qt and VTK in
> your project so you can hand someone without those tools your code and
> it will run.
>
> Is this the goal and it is just not that easy (yet)? Or I am missing
something?
>
> David D.
>


The goal is simply this:

- given:
 -- an executable target, that happens to be a bundle app on the Mac
 -- a full path to that bundle in the install tree
 -- a list of plugins that you have also already installed in the bundle
 -- a list of directories where to find libraries that your executables and
plugins depend on

that the following CMake code:

install(CODE "
  include(BundleUtilities)
  fixup_bundle(\"${YOUR_BUNDLE_PATH}\" \"\${YOUR_PLUGINS}\"
\"${YOUR_LIBRARY_DIRS}\")
  " COMPONENT Runtime)

will do all the analysis and copying and fixing up of dependent libraries
that is mechanically possible...

So that you do not even have to mention VTK and Qt to your install rules at
all.

If you have to say anything about VTK or Qt beyond target_link_libraries,
then BundleUtilities is a failure.


David C.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to