[CMake] Adding Core Data model files to a CMake generated Xcode project

James Munro me at jdmunro.net
Thu Dec 8 07:47:40 EST 2011


Hi there,

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.

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):

AppName.xcdatamodeld/
- AppName.xcdatamodel/
  - contents (file without an extension)

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.

Has anybody solved this problem before, or can perhaps point me in the
correct direction?

Kind regards
James Munro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111208/26c11ba8/attachment.htm>


More information about the CMake mailing list