<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I'm targeting iOS (device and simulator) and setting up CMake to add the different resources needed in the bundle.</div><div>The "xib" file is giving me some problems.</div><div>If I take no further action, the iPhone/iPad simulator run fails with the error:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><b>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/danieldekkers/Library/Application Support/iPhone Simulator/4.3.2/Applications/1C29638B-7593-4311-8F94-C8051AF90AD7/Discs.app> (loaded)' with name 'MainWindow''</b></div></div><div><br></div><div>A missing NIB file in the bundle. </div><div>An example (<a href="http://www.vtk.org/Wiki/CMake:OSX_InterfaceBuilderFiles">http://www.vtk.org/Wiki/CMake:OSX_InterfaceBuilderFiles</a>) shows that for OSX, you have to compile the xib files into nib files and add these to the bundle as a post-build step.</div><div>So my guess would be that something similar holds for iOS as well.</div><div>But my question is,... where do i add the compiled nib files?</div><div><br></div><div>I now do this in the CMakeLists.txt:</div><div><br></div><div><div># We need to compile the interface builder *.xib files to *.nib files to add to the bundle</div><div># Make sure we can find the 'ibtool' program. If we can NOT find it we skip generation of this project</div><div>FIND_PROGRAM( IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" )</div><div>if ( ${IBTOOL} STREQUAL "IBTOOL-NOTFOUND" )</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>MESSAGE( SEND_ERROR "ibtool can not be found" )</div><div>ENDIF()</div><div><br></div><div># Compile the .xib files using the 'ibtool' program with the destination being the app package</div><div>FOREACH( xib ${RSRC_IOS_XIB_FILES} )</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ADD_CUSTOM_COMMAND( TARGET ${RT_APP_NAME} POST_BUILD</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>--compile </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RT_APP_NAME}.app/Contents/Resources/${xib}.nib</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>${RT_APP_ROOT}/rsrc/apple/ios/${xib}.xib</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>COMMENT "Compiling ${RT_APP_ROOT}/rsrc/apple/ios/${xib}.xib")</div><div>ENDFOREACH()</div></div><div><br></div><div>But i don't really trust the "destination" of the compilation step, especially for the simulator.</div><div>Has anyone got this working?</div><div><br></div><div>Kind Regards,</div><div><br></div><div>Daniel Dekkers</div><div><br></div><div><br></div><div><br></div></body></html>