[CMake] iOS Archiving (again)

Daniel Dekkers d.dekkers at cthrough.nl
Fri Dec 9 10:41:35 EST 2011


Hi,

A small step in the iOS release archiving problem.
Note, this is all Xcode 4.0.2, Xcode 4.2 (the LLVM GCC compiler) doesn't specify the error (more than "1"), so is basically unworkable. At least the "old" GCC 4.2 compiler tells you what is going on.

For archiving to work on iOS (OSX don't know) you have to set "skip install" to "yes" for all static libs you might be using, so they don't end up in the final product:
http://developer.apple.com/library/ios/#technotes/tn2215/_index.html

So, in the iOSNavApp example from the CMake test suite, which uses a library named Functions I set this "skip install" property to "yes" in the Functions target, and to "no" for the application target itself.
But then, during the link phase of a release archive step, the compiler can not find the library in /path/to/build/Release-iphoneos (libFunctions.a not found). Xcode doesn't copy the lib to this destination directory, could be related to:
http://www.cmake.org/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency

My "solution" now is to split the process in two phases:
1) Set "skip install" to "no" for both targets (library and application) and do a (release) archive. This will result in a corrupt ipa but at least the lib is built and copied.
2) Set "skip install" to "yes" for the lib and do an archive again. Now it will create a proper ipa.

Hope this helps a bit. Mainly in battling http://developer.apple.com/library/ios/#technotes/tn2215/_index.html

Thanks, Daniel




More information about the CMake mailing list