[CMake] iOS Archiving (Xcode 4.2, Lion, CMake2.8-6)

Daniel Dekkers d.dekkers at cthrough.nl
Mon Nov 28 07:13:20 EST 2011


Hi, David

Well, since you asked... ;-)
This one is based on your iOSNavApp example, a bit different (Universal for iPhone/iPad) but still very manageable...

run, Debug, iPhone 5.0 Simulator, check
run, Debug, iPad 5.0 Simulator, check
run, Debug, iPhone device (5.0.1), check
run, Debug, iPad device (5.0.1), check
run, Release, iPhone 5.0 Simulator, check
run, Release, iPad 5.0 Simulator, check
run, Release, iPhone device (5.0.1), check
run, Release, iPad device (5.0.1), check
archive, Debug, check
archive, Release, fail, "error 1", auch...

Would be great if you could take a look.

Thanks,
Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iOSNavAppUniversal.zip
Type: application/zip
Size: 20879 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111128/738601d3/attachment-0001.zip>
-------------- next part --------------




On Nov 26, 2011, at 5:14 PM, David Cole wrote:

> Really?
> The only error output is:
> 
>  "Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++
> failed with exit code 1"
> 
> ....?? How are we supposed to figure out what's wrong with the
> archiving step with that....?
> 
> What are the Xcode project file differences between a CMake-generated
> project that demonstrates this problem, and an Xcode generated project
> that does not...? Can you reduce it down to a simplest case that's
> easy to analyze?
> 
> 
> Thx,
> David
> 
> 
> On Fri, Nov 25, 2011 at 12:30 PM, Daniel Dekkers <d.dekkers at cthrough.nl> wrote:
>> Hi,
>> 
>> Has anyone managed to perform a successful iOS Archiving pass yet?
>> 
>> Our apps run on the simulator (both iPhone (5.0) and iPad (5.0)) and on the actual devices iPhone 3GS (5.0.1) and iPad2 (5.0.1), but archiving always gives a link error:
>> 
>> Ld /Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/InstallationBuildProductsLocation/Application/Discs.app/Discs normal armv7
>>    cd /Users/danieldekkers/development
>>    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
>>    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
>>    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/BuildProductsPath/Release-iphoneos -F/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/BuildProductsPath/Release-iphoneos -filelist /Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/IntermediateBuildFilesPath/All.build/Release-iphoneos/Discs.build/Objects-normal/armv7/Discs.LinkFileList -dead_strip -ObjC -framework OpenGLES -framework UIKit -framework Foundation -framework CoreGraphics -framework QuartzCore -framework CoreData -framework Coremotion -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/danieldekkers/development/build/iOS/ES1/rendertools/src/Rel
>>  ease-iphoneos/libRenderTools.a -lz -miphoneos-version-min=4.3 -o /Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/InstallationBuildProductsLocation/Application/Discs.app/Discs
>> Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ failed with exit code 1
>> 
>> This is a problem, because you have to archive an ipa file, AdHoc or AppStore to ship your application.
>> 
>> These are our IOS specific settings at the moment, lots of trial-and-error, but at least they work on the simulator and attached devices:
>> 
>> IF( RT_IOS )
>>        # "Toolchain" settings can (for the time being) just be included...
>>        SET (CMAKE_SYSTEM_NAME Generic)
>>        SET (CMAKE_SYSTEM_VERSION 1)
>>        SET (CMAKE_SYSTEM_PROCESSOR arm)
>> 
>>        SET (RT_SDKVER "5.0" CACHE PATH "iOS SDK version" )
>>        SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
>>        SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${RT_SDKVER}.sdk")
>>        IF( EXISTS ${SDKROOT} )
>>                SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
>>        ELSE()
>>                MESSAGE( "Warning, iOS SDK path not found: " ${SDKROOT})
>>        ENDIF()
>>        SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either "$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"
>> 
>>        # SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc")      # Can be removed, just let Xcode choose the default.
>>        # SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++")    # Can be removed, just let Xcode choose the default.
>> 
>>        SET (CMAKE_FIND_ROOT_PATH "${DEVELOPMENT_ROOT}" "${SDKROOT}" "${DEVROOT}")
>>        SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
>>        SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
>>        SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>> 
>>        SET( RT_DEPLOYMENT_TARGET "4.3" CACHE STRING "minimum required SDK" )
>> 
>>        SET( GCC_INPUT_FILETYPE "Objective-C++" )
>>        SET( CMAKE_CXX_FLAGS "-x objective-c++ -mno-thumb" )
>> 
>>        # For iOS builds this is needed for the app to initiate the UIApplication delegate instance...
>>        SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ObjC" )
>> 
>>        # Look in the correct build directories when linking the app to the RenderTools library...
>>        SET( CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" )
>> ENDIF()
>> 
>> Just wondering if someone is following the same path.
>> 
>> 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