Set the Xcode lastKnownFileType attribute on its reference to a source file. CMake computes a default based on file extension but can be told explicitly with this property.
See also XCODE_EXPLICIT_FILE_TYPE, which is preferred over this property if set.