MantisBT - CMake
View Issue Details
0014479CMakeCMakepublic2013-10-11 11:282014-03-05 09:58
Michael Priestman 
Brad King 
highmajoralways
closedfixed 
AppleMac OS X10.7.5
CMake 2.8.11.2 
CMake 2.8.12CMake 2.8.12 
0014479: XCODE_DEPEND_HELPER.make doesn't work with iOS applications
When working with static libraries in Xcode, there is a post-build step added by CMake to clean targets when a static lib is built. This is to work-around known limitations in Xcode.

The file that does the real work is XCODE_DEPEND_HELPER.make, and it includes lines of the format:

/bin/rm -f /<path-to-outdir>/bin/Debug/test.app/Contents/MacOS/test

This works fine for Mac OS apps, but doesn't work correctly for iOS apps. In that case, the actual binary file is not inside a "Contents/MacOS" folder, but instead just directly under the app directory, so the correct command should be:

/bin/rm -f /<path-to-outdir>/bin/Debug/test.app/test

Is there some setting that the iOS.cmake toolchain could set that would alter what is generated in this file? Or would CMake need to be extended to allow customisation of this file?
Create a CMake project that uses the ios-cmake toolchain (https://code.google.com/p/ios-cmake/ [^]) that contains a static lib and an iOS app that links against the static lib.

Build the app. Then update the code in the library.

When you build the app again, it won't relink the new library.
Should this defect actually be raised against the ios-cmake toolchain project instead?
No tags attached.
Issue History
2013-10-11 11:28Michael PriestmanNew Issue
2013-10-11 11:32Brad KingNote Added: 0034104
2013-10-11 11:35Brad KingNote Added: 0034105
2013-10-21 05:31Michael PriestmanNote Added: 0034178
2013-10-21 08:32Brad KingAssigned To => Brad King
2013-10-21 08:32Brad KingStatusnew => resolved
2013-10-21 08:32Brad KingResolutionopen => fixed
2013-10-21 08:32Brad KingFixed in Version => CMake 2.8.12
2013-10-21 08:32Brad KingTarget Version => CMake 2.8.12
2014-03-05 09:58Robert MaynardNote Added: 0035287
2014-03-05 09:58Robert MaynardStatusresolved => closed

Notes
(0034104)
Brad King   
2013-10-11 11:32   
XCODE_DEPEND_HELPER is a hack we had to use to work around the lack of link dependency checking in OTHER_LDFLAGS by Xcode. Fortunately Xcode 5 finally fixed that limiation.

CMake >= 2.8.12 with Xcode >= 5 does not use XCODE_DEPEND_HELPER.
(0034105)
Brad King   
2013-10-11 11:35   
For reference, the reason ios targets to not appear where CMake expects them is:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c030ef7 [^]
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59a22655 [^]
(0034178)
Michael Priestman   
2013-10-21 05:31   
Thanks for the quick feedback Brad.

I've tested this with XCode 5 and CMake 2.8.12, and it now appears to work as expected. So you can resolve this as fixed for me.
(0035287)
Robert Maynard   
2014-03-05 09:58   
Closing resolved issues that have not been updated in more than 4 months