[CMake] BundleUtilities not working

Bill Hoffman bill.hoffman at kitware.com
Tue Jul 28 11:03:01 EDT 2015


On 7/28/2015 8:59 AM, Bill Somerville wrote:
> Hi,
>
> I am suffering issues with BundleUtilities fixup_bundle() when used on
> Windows with MinGW. The issue is because the underlying GetPrerequisites
> module uses the MS dumpbin.exe utility to find dependent libraries of
> executables. This is a problem because it crashes on many libraries and
> executables from later MinGW tools, for example the GNU Fortran library
> libgfortran-3.dll. I believe the crash is due to the DLL having no symbols.
>
> The problem is exacerbated by GetPrequisites having very little error
> checking so it silently fails and doesn't install the dependent libraries.
>
> GetPrerequisites can use objdump if dumpbin is not available but this
> has another issue. The output from 'objdump -p <executable>' can be very
> long, over 10000+ lines for a large Qt library for example, and this
> causes GetPrerequsites to run exceedingly slowly as it uses
> execute_process() to capture the output into a CMake variable then
> parses it with string(REGEX REPLACE ...) and a loop doing an if(...
> MATCHES <regexp>) on every line.
>
> So I have a choice of broken or too slow for practical use :(
>
> Is BundleUtilities.cmake and GetPrerequisites.cmake maintained, if so
> who by? I can suggest a few improvements, the main one being to filter
> the command output used to get prerequisites in a pipeline
> (execute_command() with multiple commands using grep) and better error
> checking. Also perhaps dumpbin should only be used if objdump is not
> available.

It is not supported by anyone in particular.  However, it is a supported 
and well used part of CMake.  I would suggest that you create a patch, 
and work on the cmake-developers mailing list:
http://www.cmake.org/gitweb?p=cmake.git;a=blob_plain;f=CONTRIBUTING.rst;hb=master

Looking at the code, it seems that objdump is intended for MinGW.  I 
wonder if there is a less verbose mode that can get the same 
information.  OR, it seems that MinGW has ldd (at least mine does). 
What happens if you use the ldd mode?

I would suggest that you try some stuff and see what actually works with 
your system and then report back to the cmake-developers list with 
either a complete patch or an approach that works and I can help you get 
it into CMake.  Thanks for the contribution.

-Bill



More information about the CMake mailing list