[cmake-developers] [CMake 0014498]: Folder references aren't added correctly to Xcode projects.

Mantis Bug Tracker mantis at public.kitware.com
Mon Oct 21 05:51:06 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14498 
====================================================================== 
Reported By:                Michael Priestman
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14498
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-21 05:51 EDT
Last Modified:              2013-10-21 05:51 EDT
====================================================================== 
Summary:                    Folder references aren't added correctly to Xcode
projects.
Description: 
With the change that fixed issue 0014093, another issue has arisen.

If you try to add a folder reference into an Xcode project, then the incorrect
file type is set on the reference, and Xcode cannot access the files inside the
folder, saying instead that it has no permissions.

I have a folder that contains some image assets for an iOS project, and I want
to just add the entire folder (which has subfolders) to an Xcode project. I do
this by just including the path to the folder.

With CMake 2.8.11.02, this worked fine. But with the change mentioned above, the
reference now has an "explicitFileType" attribute, which is set to "sourcecode".
It appears Xcode isn't happy with this.

If you add a folder reference to an Xcode project, I think the explicitFileType
attribute should be set to "folder". I discovered this by explicitly setting the
file type in Xcode to "Directory" and resaving the project. If you do this, then
Xcode can once again access the contents of the folder.

So whilst technically this could be a bug with Xcode (tested with 4 and 5, same
behaviour), I don't think it should be too hard to fix in CMake. If you can tell
a given source file reference is actually a folder reference, then you can just
say the explicitFileType is "folder" instead of "sourcecode".

This isn't a major issue as if you want to access the folder in Xcode, you can
just manually update the file type, but obviously you'd have to do that each
time you regenerate the project.

Steps to Reproduce: 
Create a directory that contains a simple source file and single folder that
contains, say, an image.

Create a simple CMake file that defines a library that contains a reference to
the folder.

Generate an XCode project from the CMake file.

Load XCode project, and try to navigate to the folder. You will get an error.

Set the file type to "Directory", then you can access the contents of the
folder.

Attached is a sample that demonstrates this problem.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-21 05:51 Michael PriestmanNew Issue                                    
2013-10-21 05:51 Michael PriestmanFile Added: sample.zip                       
======================================================================




More information about the cmake-developers mailing list