[cmake-developers] fixup_bundle with @loader_path

Simon Wells swel024 at gmail.com
Wed Jan 13 01:38:18 EST 2016


I currently have boost installed through brew of which kicad uses

libboost_context-mt.dylib

this library then depends on

libboost_chrono-mt.dylib

the otool -L for libboost_context-mt.dylib for chrono is
@loader_path/libboost_chrono-mt.dylib

After having numerous issues with trying to get this working as it kept
saying that @loader_path/libboost_chrono-mt.dylib was not found, I was
doing some testing with the help of Lewoco and found a few things

BundleUtilities.cmake requests a list of prerequisites using
get_prerequisites and theoretically this should return the full path that
was found in gp_resolve_items (from get_prerequisites) however due to how
get_prerequisites functions the full path is not being added to the
prerequisites_var which is "returned".

I believe this has to do with
 gp_append_unique(${prerequisites_var} "${item}")
as that would add the @loader_path version of the path rather than the
resolved path. And when its recursive, and so the full path is then used in
a recursive call to get_prerequisites the function doesn't allow it to add
itself to the list.

unfortunately i don't understand enough about how the function actually
works to know the best way to patch this but i assume it would be better if
only resolved items were added to the prerequisite_vars as otherwise its
possible they would not have enough information to be resolved later

If i am missing something or have made a mistake somewhere please let me
know

thanks

Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160113/a09dd41d/attachment-0001.html>


More information about the cmake-developers mailing list