[CMake] Xcode Archiving on iOS and OSX
Jamie Hales
jamie at pixelballoon.com
Mon Dec 17 05:52:47 EST 2012
I've got a little further with this over the weekend. By doing a "Product->Build For->Archiving" before "Product->Archive" seems to build the xcode archives into the correct location, I'm not sure why this is the case. Regardless, that allows it to link correctly. The problem then is it by default creates a 0 byte xcarchive file. This is apparently because the default install path is empty, which Xcode doesn't like. Skip install is also set on the project target by default, which is incorrect.
You can solve this by setting the following properties on the application target.
set_target_properties(${projectname} PROPERTIES
XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
XCODE_ATTRIBUTE_SKIP_INSTALL "No"
)
This seemingly allows the creation of a valid archive, so it's usable, there's just the extra step of having to build before archiving. If anyone has any suggestions on how to solve that final hurdle it would be greatly appreciated!
Kind Regards,
Jamie Hales
+44 7775 647071
On Friday, 14 December 2012 at 12:22, Jamie Hales wrote:
> Apologies, I hit send before I was ready -
>
> I tried setting various attributes -
>
> set(CMAKE_XCODE_ATTRIBUTE_INSTALL_PATH "test")
> set(LIB_INSTALL_DIR, ${CMAKE_INSTALL_PREFIX})
> set(LIBRARY_OUTPUT_DIRECTORY, ${CMAKE_INSTALL_PREFIX})
>
> But this doesn't seem to make any difference.
>
> Is anyone aware of a proper solution to this issue, or a temporary workaround? I'm willing to try anything, as this is the only bottleneck I've found so far, but it's basically a showstopper if I can't get it to work.
>
> Any suggestions, questions or solutions are highly welcome!
>
> Many thanks.
>
> Kind Regards,
> Jamie Hales
>
>
> On Friday, 14 December 2012 at 12:20, Jamie Hales wrote:
>
> > Hi,
> >
> > I'm currently trying to change my existing multiple project setup (manually maintaining makefiles, vsproj and xcodeproj) for a single cmake solution. So far it's going well, I have the OSX and iOS targets up and running correctly when running directly on the device, but I'm having issues when archiving.
> >
> > Basically whenever I try to archive I get linker errors for every separate static library I'm using (also compiled with cmake)
> >
> >
> > clang: error: no such file or directory: '/Users/aeonflame/Dropbox/Development/pixelballoon/astraeus/build/ios/pixelboost/engine/Release-iphoneos/libpixelboost_engine.a'
> >
> >
> > clang: error: no such file or directory: '/Users/aeonflame/Dropbox/Development/pixelballoon/astraeus/build/ios/pixelboost/libs/box2d/Box2D/Release-iphoneos/libBox2D.a'
> >
> >
> > clang: error: no such file or directory: '/Users/aeonflame/Dropbox/Development/pixelballoon/astraeus/build/ios/pixelboost/libs/freetype2/Release-iphoneos/libfreetype2.a'
> >
> >
> > clang: error: no such file or directory: '/Users/aeonflame/Dropbox/Development/pixelballoon/astraeus/build/ios/pixelboost/libs/librocket/Release-iphoneos/liblibrocket.a'
> >
> >
> > clang: error: no such file or directory: '/Users/aeonflame/Dropbox/Development/pixelballoon/astraeus/build/ios/pixelboost/libs/lua/Release-iphoneos/liblua.a'
> >
> >
> >
> > These are included in the main project in the standard way -
> >
> > target_link_libraries (pixelboost_engine Box2D freetype2 librocket lua)
> > target_link_libraries (astraeus pixelboost_engine)
> >
> > There's no issue when running directly, it's only when archiving.
> >
> > I've been searching for about 2 days for a solution to this but can't find a solution yet. I've come across some vague references to setting the library install path, so I have tried setting various attributes -
> >
> >
> > Kind Regards,
> > Jamie Hales
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121217/d42d8d44/attachment.htm>
More information about the CMake
mailing list