[CMake] CMake, iOS and .xib compilation

Daniel Dekkers d.dekkers at cthrough.nl
Tue Sep 20 11:25:08 EDT 2011


Hi,

I'm really having a hard time creating a CMake setup for iOS.

After...
- the toolchain files for cross-compiling, 
- the Settings.bundle,
- the Info.plist file,
- the provisioning profiles, 
- the entitlements,
...the latest chapter consists of the Interface Builder .xib files.

An iOS application bundle needs a .nib file that is compiled from a .xib file and added to the application bundle. I've got a script for that:

		# We need to compile the interface builder *.xib files to *.nib files to add to the bundle
		# Make sure we can find the 'ibtool' program. If we can NOT find it we skip generation of this project
		FIND_PROGRAM( IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" )
		if ( ${IBTOOL} STREQUAL "IBTOOL-NOTFOUND" )
  			MESSAGE( SEND_ERROR "ibtool can not be found" )
		ENDIF()

		# Compile the .xib files using the 'ibtool' program with the destination being the app package
		FOREACH( xib ${RSRC_IOS_XIB_FILES} )
			ADD_CUSTOM_COMMAND( TARGET ${APP_NAME} POST_BUILD
				COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text
					--compile
					${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RT_APP_NAME}.app/${xib}.nib # iOS uses a flat hierarchy, place directly under .app
					${APP_ROOT}/rsrc/apple/ios/${xib}.xib
					COMMENT "Compiling ${APP_ROOT}/rsrc/apple/ios/${xib}.xib")
		ENDFOREACH()

But once I use the script. I constantly receive a "A signed resource has been added, modified, or deleted." error when running on the device.
This makes some sense, because all the files in the bundle are codesigned and adding a new .nib file for every build might give signing problems.

But I'm running out of ideas how to fix this.
Any suggestions?
Or, more general... is there anyone else who is walking, or has walked, this CMake/iOS path?

Kind Regards,

Daniel Dekkers





More information about the CMake mailing list