[CMake] BundleUtilities

David Doria daviddoria at gmail.com
Wed Nov 17 13:56:49 EST 2010


>
> 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.
>
>
Ok, progress, and more questions:

1) I think it worked, check it out.:
http://www.vtk.org/Wiki/CMake/CPack/BundleUtilities/Examples/Linux/Automatic

Though the .deb created is 37MB, where when I manually included vtkHybrid.a
it was only 2MB...

2) Do I need both the INSTALL(TARGETS... and INSTALL(CODE... ? Could these
be combined into one command? It seems like there is a lot of duplication (I
am specifying the executable twice, etc).

3) Is there a way to lose all the $,\, and " in the syntax? That is, change:

fixup_bundle(\"${APPS}\" \"\${YOUR_PLUGINS}\" \"${YOUR_LIBRARY_DIRS}\")

to:

fixup_bundle(${APPS} ${YOUR_PLUGINS} ${YOUR_LIBRARY_DIRS})

That would make it seem much easier to use, even if it really isn't any
easier :)

<http://www.vtk.org/Wiki/CMake/CPack/BundleUtilities/Examples/Linux/Automatic>4)
I'm still not sure what is going on with this business:

    BUNDLE DESTINATION . COMPONENT Runtime
    RUNTIME DESTINATION bin COMPONENT Runtime

I think a definition of a "bundle" a "destination", a "component" and
"runtime" should be provided here:
http://www.itk.org/Wiki/BundleUtilitiesExample

5) Why do you have to specify the Library_Dirs? Can't it just use the same
list that it uses to look for vtkHybrid when I specify it in the
target_link_libraries:

TARGET_LINK_LIBRARIES(VTKIncludeTest vtkHybrid)

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101117/fddeddd9/attachment.htm>


More information about the CMake mailing list