[CMake] Question about BundleUtilities
Marco Nolden
m.nolden at dkfz-heidelberg.de
Fri Oct 22 12:33:12 EDT 2010
On 10/22/2010 05:30 PM, David Cole wrote:
> On Fri, Oct 22, 2010 at 11:22 AM, Marco Nolden
> <m.nolden at dkfz-heidelberg.de <mailto:m.nolden at dkfz-heidelberg.de>> wrote:
>
> On 10/19/2010 11:26 PM, David Cole wrote:
>
>
> What is the exact problem here? Mac or Linux? You said it works after
> "make install" but then the copied libs do not end up in the CPack
> package? (By default, CPack just does a make install to construct its
> install tree for packaging. Are you overriding it somehow?)
>
No override, minimal CPack configuration, I added just a
"include(CPack)" without any extra configuration.
Mac:
1. After "make install" the fixup_bundle copies all external libraries
(e.g. ITK in our little test project) to the install tree and all paths
are fixed correctly.
2. I added just a include(CPack) without extra configuration.
3. "cpack -G DragNDrop" shows some extra debug output from fixup_bundle
we added. The paths in these messages are referring to the install tree,
so I guess the script is working there.
But: in the binary tree there is a folder
_CPack_Packages/Darwin/DragNDrop/Project-0.1.1-Darwin which contains
just the executable and the libraries which have explicit INSTALL(TARGET
) commands, none of the external prerequisites that got pulled in by
fixup_bundle.
Linux:
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: Project
CPack: - Install project: Project
CMake Error at /home/nolden/bundle-test-src/BundleUtilities.cmake:745
(message):
error: verify_app failed
Call Stack (most recent call first):
/home/nolden/bundle-test-src/BundleUtilities.cmake:627 (verify_app)
/home/nolden/bundle-bin/main/cmake_install.cmake:99 (fixup_bundle)
/home/nolden/bundle-bin/cmake_install.cmake:40 (INCLUDE)
CPack Error: Error when generating package: Project
Same situation here: everthing fine in the install dir, but in the
_CPack_Packages folder the external libraries are missing.
>
> BTW, the BundleUtilities are a great tool, I think you should
> advertise it more, also for Linux and Windows.
>
>
> Thanks! It's really great that so many people have taken it up and
> started using it. Especially thanks to Clinton Stimpson for all of his
> effort to make it work well everywhere, not just on the Mac.
>
> Where/how would you suggest we advertise it more? We pretty much count
> on word-of-mouth of satisfied folks like you to spread the word for us...!
>
>
> Thanks,
> David Cole
>
We will spread the word! But it was somehow a lucky find because we
started with the information from the CPack Package Generators page
which lists a lot of OSX generators and describes start scripts and
things like that. I think a link to the BundleUtilities page would help
here. And since it is cross platform I would also vote for another name ...
Best,
Marco
>
>
> Best,
>
> Marco
>
>
>
>
> On Tue, Oct 19, 2010 at 5:14 PM, Marco Nolden
> <m.nolden at dkfz-heidelberg.de
> <mailto:m.nolden at dkfz-heidelberg.de>
> <mailto:m.nolden at dkfz-heidelberg.de
> <mailto:m.nolden at dkfz-heidelberg.de>>> wrote:
>
> On 10/19/2010 05:47 PM, David Cole wrote:
>
> This likely means that "otool -L" on libA is reporting
> "/Users/engelm/bundle-test/install/MacOS/liblibB.dylib" as a
> dependent library... If that's true, then why doesn't
> the library
> exist?
>
> It exists in the build tree but we did not add install
> commands for
> it, because we thought it would be done by the BundleUtilities
> script (and in fact on linux libB does get copied to the install
> tree automatically).
>
> So is this "automatic copying" of libraries intended for
> libraries
> in the same project as well or is it only intended for 3rd party
> libraries from other directories?
>
>
>
> Do you build libA against a build tree including libB or
> against
> an install tree of libB...?
>
> Both libraries are built within the same project.
>
>
> Yes, that is basically the intended usage of
> BundleUtilities. It
> looks like you are using it correctly. Errors are
> difficult to
> diagnose, though.....
>
>
> I know, we already spent some time trying to get it to work
> ;) Is
> the test project useful? Can we help in some other way?
>
> Best
> Marco
>
>
> HTH,
> David
>
>
> On Tue, Oct 19, 2010 at 10:34 AM, Marco Nolden
> <m.nolden at dkfz-heidelberg.de
> <mailto:m.nolden at dkfz-heidelberg.de>
> <mailto:m.nolden at dkfz-heidelberg.de
> <mailto:m.nolden at dkfz-heidelberg.de>>>
>
> wrote:
>
> Dear all,
>
> we have some problems using the BundleUtilities
> macro for
> deployment on Mac OS X. I created a very small test
> project
> which is similar to our setup:
>
> http://github.com/nolden/bundle-test
>
> - libA is a plugin that would be loaded at runtime
> by means of
> dlopen (or something similar). We added an explicit
> INSTALL(TARGETS libA) for this library.
>
> - libB is a dependency of libA
>
> - Main is an indepedent main application that would in
> practice load libA with dlopen (not in the example)
>
> Calling fixup_bundle with libA as a plugin gives
> some errors
> on Mac OS, because libB is not copied to the install
> tree:
>
> Install the project...
> -- Install configuration: ""
> -- Installing:
> /Users/engelm/bundle-test/install/lib/liblibA.dylib
> -- Installing:
> /Users/engelm/bundle-test/install/bin/Main
> GetPreReq
> -- fixup_bundle
> -- app='/Users/engelm/bundle-test/install/bin/Main'
> --
> libs='/Users/engelm/bundle-test/install/lib/liblibA.dylib'
> -- dirs='/Users/engelm/bundle-test/bin/bin'
> -- fixup_bundle: preparing...
> -- warning: embedded item does not exist
> '/Users/engelm/bundle-test/install/MacOS/liblibB.dylib'
> --
>
> ******************************************************************************
> warning: cannot resolve item
> '@executable_path/../MacOS/liblibB.dylib'
>
> On Linux, the copying of the dependencies works, we
> have not
> tested windows yet.
>
> Is this the intended use of the BundleUtilities
> script? It
> looks like a very good solution for cross-platform
> deployment.
>
> Best,
>
> Marco / Sascha
>
> MITK, http://www.mitk.org
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
> <http://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
>
>
>
>
>
>
More information about the CMake
mailing list