[CMake] iOS Archiving (again)

Daniel Dekkers d.dekkers at cthrough.nl
Sat Dec 10 07:34:53 EST 2011


One more... 
A (the main?) difference between building and archiving:

Building Functions phase:
Build Functions
...
  Libtool build/Release-iphoneos/libFunctions.a normal armv7
...

Archiving Functions phase:
Build Functions
...
  Libtool Users/danieldekkers/Library/Developer/Xcode/DerivedData/[blabla]/libFunctions.a normal armv7
...

So, during a normal build, the library is placed in build/Release-iphoneos/. 
But when archiving it is placed in the "new" (since Xcode 4 I think) DerivedData folder. 
In the second case, the application won't find it while linking.

It's annoying that Xcode forces its own out-of-source build system which introduces complications, when we've got that aspect covered with CMake.

Thanks,
Daniel

On Dec 9, 2011, at 4:41 PM, daniel dekkers wrote:

> 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
> 
> 
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list