[CMake] Problem with fixup bundle and duplicate change commands on macOS

Luis Caro Campos julius.caro at gmail.com
Fri Jun 23 07:47:15 EDT 2017


Hi Lukas,

Could you provide some details? Please do correct me if any of my
assumptions are wrong.

You are calling FIXUP_BUNDLE on an executable created this way:
add_executable(MyAppName MACOSX_BUNDLE ...),

and you need are calling FIXUP_BUNDLE so that the 3rd party library
dependencies are pulled into the bundle, so that the bundle becomes
standalone.

Is FIXUP_BUNDLE being called at build time ("make"), perhaps as custom
command that depends on the application target, or install time ("make
install"), as part of the INSTALL(...) directive in a cmake script?

What exactly do you mean by "duplicate commands" ?

In order to make the bundle standalone, I believe FIXUP_BUNDLE iteratively
goes through the dependencies of the main executable, which are 'hardcoded'
in the executable. You can list the depencies using
$ otool -L executableName

For each dependency (dylib shared library or a Framework), the dependencies
will be copied to the Frameworks folder in the bundle, based on their
install name, and the executable will be fixed using install_name_tool to
make sure that non-system libraries are loaded from the Frameworks folder.
If these dependencies have other dependencies, install_name_tool is also
called on them.

Sometimes there are hiccups, and unfortunately in some cases it may be
difficult to produce a truly re-locatable bundle if the install names of
some libraries are not fully "correct".

Regards,
Luis


On Thu, Jun 22, 2017 at 6:01 PM, Schulte, Lukas <lukas.schulte at mpibpc.mpg.de
> wrote:

> Hey guys,
>
>
>
> So I’m trying to use fixup_bundle for our software, and for a reason that
> I can’t wrap my head around executing fixup_bundle results in a call to
> install_name_tool where in the changes variable some commands are
> duplicate (in my case, double deletion of an rpath during fixing up of
> some Qt dependencies, namely QtWebViewEngineCore).
>
> I didn’t find anyone with the same problem as me on the internet so I
> figured I would just ask you guys for advice.
>
>
> I’m using CMake 3.3.2 , Qt 5.9 and OsX 10.11.6.
>
> So my question is – what would be my best way of action here? As this is
> happening with automatically resolved dependencies, I don’t have much
> option to handle this in my own CMake files.
>
>
>
> What I could think of if there’s not something im doing horribly wrong
> was implementing a duplicate removal in BundleUtitilties.cmake which I
> would then discuss on the Developer List I guess- does anyone happen to
> have any better ideas or hints what I could do to solve this?
>
>
>
>
> Thanks in advance!
>
>
>
> Lukas
>
> ------------------------------------------------------------
> --------------------------
>
>
>
> Lukas Schulte
>
> PhD Student
>
> Max-Planck-Institute for biophysical Chemistry
>
> Department of Structural Dynamics
>
> Am Fassberg 11
>
> D-37077 Goettingen
>
> +49-551-201-1410 <+49%20551%202011410>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170623/291c473c/attachment.html>


More information about the CMake mailing list