[CMake] iOS Archiving (again)

Daniel Dekkers d.dekkers at cthrough.nl
Tue Dec 13 11:27:00 EST 2011


Hi,

I'm starting to get really worried about the iOS archiving when having to link to a static library. I'm writing an article where I'm "selling" CMake as a way to do cross-platform development for OpenGL/ES applications, including iOS. I have to decide now if I have to put a disclaimer in the article, delimiting CMake iOS builds to builds without  static libraries, which will put people off. A disclaimer would frustrate me very much because it feels like iOS support is *almost* on top of the hill (like 99%). The applications work, on devices and simulators, code signing, resources, everything. The only thing is archiving, which shouldn't really be that big of a deal anyway. But it is, and it's essential in the sense that if you can't archive, you can't distribute your application. It would feel wrong not warning readers about that.

Please let me know what you think. Should i feel confident that "it will work eventually", in say three months, before the book comes out. Or is there some structural problem going on, more than lack of interest. 

Thanks,
Daniel

On Dec 10, 2011, at 1:34 PM, Daniel Dekkers wrote:

> 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
> 
> --
> 
> 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