MantisBT - CMake
View Issue Details
0015202CMakeCMakepublic2014-10-10 16:592015-04-06 09:07
Mark Manthei 
David Cole 
normalblockalways
closedno change required 
Apple MacOS X10.7, 10.8, 10.9
CMake 3.0.2 
 
0015202: BundleUtilities.cmake - function fixup_bundle_item fails with very long path
when fixing up a very long exe inside of a bundle, the code attempts to figure out if the item is embedded in the bundle. The current logic fails because the SUBSTRING search starts at offset 0 and can fail to find the embedded item in the given length.

From debug output of BundleUtilities.cmake:

-- 22/42: fixing up '/Users/autobuild/hudson/workspace/Product-Mac/build/Installed/Really Long App Name.app/Contents/MacOS/embeddeditem
exe_dotapp_dir/='Installed/Really Long App Name.app/'
item_substring='/Users/autobuild/hudson/workspace/R'
Use long paths.
Patch to fix issue, CMake version 3.0.2 attached
No tags attached.
patch BundleUtilities.patch (586) 2014-10-10 16:59
https://public.kitware.com/Bug/file/5272/BundleUtilities.patch
Issue History
2014-10-10 16:59Mark MantheiNew Issue
2014-10-10 16:59Mark MantheiFile Added: BundleUtilities.patch
2014-10-10 17:16David ColeNote Added: 0037019
2014-10-10 17:17David ColeNote Added: 0037020
2014-10-10 17:18David ColeNote Added: 0037021
2014-10-10 17:18David ColeStatusnew => resolved
2014-10-10 17:18David ColeResolutionopen => no change required
2014-10-10 17:18David ColeAssigned To => David Cole
2015-04-06 09:07Robert MaynardNote Added: 0038422
2015-04-06 09:07Robert MaynardStatusresolved => closed

Notes
(0037019)
David Cole   
2014-10-10 17:16   
It looks to me like the value of exe_dotapp_dir should be "/Users/autobuild/hudson/workspace/Product-Mac/build/Installed/Really Long App Name.app/" and the fact that it's not is what your problem is...

It should be a full absolute path, not a partial/relative path...

This patch should be unnecessary.

What are your arguments to fixup_bundle? All dirs should be ABSOLUTE full path directories when passed in as args to the function.
(0037020)
David Cole   
2014-10-10 17:17   
The point of that code is that the path of the already embedded item *starts with* the the path of the .app directory. So it doesn't make sense to start the scan at anything other than 0.
(0037021)
David Cole   
2014-10-10 17:18   
patch is incorrect - do not apply...
(0038422)
Robert Maynard   
2015-04-06 09:07   
Closing resolved issues that have not been updated in more than 4 months.