Just to quickly update on this issue:<div><br></div><div>I have made some progress, and the file is now included in the generated project:</div><div><br></div><div><div># Core Data model.</div><div>set (data_model Resources/Data/${NAME}.xcdatamodeld)</div>
<div>set (APP_TYPE MACOSX_BUNDLE)</div><div>add_executable (${NAME}</div><div> ${APP_TYPE}</div><div> ${headers}</div><div> ${sources}</div><div> ${resources}</div><div> ${data_model}</div><div> ${PROJECT_SOURCE_DIR}/Source/${NAME}-Prefix.pch</div>
<div>)</div><div>set_target_properties (${NAME} PROPERTIES RESOURCE ${resources} ${data_model})</div><div><br></div><div>There are still a couple of issues: Xcode doesn't technically recognise it as the correct filetype, so you don't get to use the built in editor for this file type. Additionally, it is not added to the project's build target, I can't work out why. Adding it manually by ticking the relevant target checkbox causes it to be included and compiled/handled correctly when running the project.</div>
<div><br></div><div>So there's 2 remaining issues:</div><div><br></div><div>1. Xcode doesn't recognise the file type correctly.</div><div>2. It is not added to the build target.</div><div><br></div><div>I suspect that the Xcode project generator code is simply not aware of this type of file.</div>
<div><br></div><div>Kind regards</div><div><br></div><div>James Munro</div><br><div class="gmail_quote">On Thu, Dec 8, 2011 at 12:47 PM, James Munro <span dir="ltr"><<a href="mailto:me@jdmunro.net">me@jdmunro.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi there,<div><br></div><div>I use CMake as part of a project configuration system with several other developers. We are very happy with this and it works well for our needs, however I recently stumbled on a problem and I'm looking for guidance. Normally I can easily add source files and resources that must appear in the generated project, but I'm currently struggling to correctly configure this for an Xcode-produced Core Data data model file.</div>
<div><br></div><div>Xcode normally treats this as a file, but it in fact just a directory with a file extension (similar to an Xcode project file itself):</div><div><br></div><div>AppName.xcdatamodeld/</div><div><span>- </span>AppName<span>.xcdatamodel/</span></div>
<div><span> - contents (file without an extension)</span></div><div><span><br></span></div><div><span>I'm not that experienced with CMake, and so far I've only tried to add them by doing a file() GLOB_RECURSE within the directory where this file resides. The files are then added to the project with add_executable. However, Xcode has the individual files but does not recognise it as a Core Data model file, which is essential for editing this file with the editor. It is also not included correctly when compiling the project.</span></div>
<div><span><br></span></div><div>Has anybody solved this problem before, or can perhaps point me in the correct direction?</div><div><br></div><div>Kind regards</div><span class="HOEnZb"><font color="#888888"><div>James Munro</div>
</font></span></blockquote></div><br></div>