[CMake] Gathering up required shared libraries

Gregory Crosswhite gcrosswhite at gmail.com
Tue Aug 2 15:42:47 EDT 2011


On 8/2/11 9:28 AM, Clinton Stimpson wrote:
> You shouldn't need to copy GetPrerequisites and BundleUtilities.
>
> For Linux you can do:
> set_target_properties( ... PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib")
>
> To get /usr/lib/ to be treated as non-system libraries, you can implement
> gp_resolved_file_type_override()
> to adjust that behavior.
> See gp_item_default_embedded_path() in GetPrerequisites for more information.
>
> And finally, to copy the dependents into lib/ instead of bin/, you can
> implement
> gp_item_default_embedded_path_override()
> to return a different path.
> See gp_resolved_file_type() in GetPrerequisites for more information.
>

Okay, so that gets me *nearly* everything that I want, but my new 
problem is that on Mac OSX fixup_bundle incorrectly assumes that the 
bundle directory is where the executable is --- namely, bin/, rather 
than the installation directory --- and then complains that the 
libraries have not been copied into the bundle; if I instead pass in the 
installation directory then it complains because it isn't a ".app" dir.  
Thanks to your advice I now know to specifically look for *_override 
hooks in the BundleUtilities, but unfortunately unless I am missing 
something it looks like there are no such hooks that will let me change 
this behavior, so I will need to copy BundleUtilities and then modify 
get_dotapp_dir to return the parent of the directory of the executable 
rather than the directory of the executable itself.

Could I request that overrides be added to in BundleUtilities similar to 
the ones in GetPrerequisites so that someone facing my situation won't 
have to do this in the future?  It looks to me though like an override 
in get_dotapp_dir might suffice, and I could easily implement that 
myself by following the pattern for overrides in GetPrerequisites and 
then send you all a patch, but you all have a better sense of the big 
picture than a relative newcomer to hacking on CMake like myself so I 
would be happy for any feedback you have on this idea.  :-)

Cheers,
Greg


More information about the CMake mailing list