How can I preserve subgroups when changing role to public in Copy Headers build phase in XCode?

929 views Asked by At

currently, the hierarchy is flattened out, and all the headers files are copied into a single Headers directory, no matter what subfolder they were in, in my Classes folder.

This is a problem when referencing the headers, if the headers have "include" statements that reference other headers in subfolders.

in particular, this screws up BridgeSupport compilation.

3

There are 3 answers

0
Paul Beusterien On

From http://lists.apple.com/archives/xcode-users/2007/Oct/msg00162.html

"Try adding the folder containing the header to Xcode as a folder reference, and then add that to the Copy Headers build phase (you'll probably have to drag-drop it into the phase rather than checking the checkbox in the detail view). Folder references are the mechanism Xcode provides for preserving a directory hierarchy during a copy."

0
user2041064 On

Add source folder as reference to folder (radio button in the "Add files..." dialog). Then drag'n'drop those folders to "Build Phases->Copy Files". After this headers will be located in folders on next build.

1
Scott Lahteine On

My understanding is the Copy Headers behavior always flattens the file structure. You can either add a custom file copy or a custom script at the end of the process that copies (cp -r) the headers from their original location to your desired destination. These are viable workarounds for now. Meanwhile, definitely post your request to bugreport.apple.com.