lajos
lajos

Reputation: 25715

preserve include path in xcode

I separated my header files in folders like:

libraryA
  |-libA1.h
  |-libA2.h

libraryB
  |-libB1.h
  |-libB2.h

Xcode however removes the path by default, so

#include "libraryA/libA1.h"
#include "libraryB/libB1.h"

doesn't work, only:

#include "libA1.h"
#include "libB1.h"

How can I make xcode preserve the path names for includes?

Upvotes: 2

Views: 939

Answers (2)

Rob Napier
Rob Napier

Reputation: 299623

In the build pane for the target, set Header Search Paths to $(SRCROOT) (assuming these are at the top level), or $(SRCROOT)/include, or whatever matches. I only suggest using the build pane here for simplicity sake. I actually recommend that people abandon the build pane and use xcconfig files, in which case, the setting is HEADER_SEARCH_PATHS.

Upvotes: 4

Lily Ballard
Lily Ballard

Reputation: 185841

The groups in Xcode's file list don't necessarily correspond to folders on disk. If you really want them to work that way, you need to create folders in your source tree, move your headers there, then get info on your file groups in Xcode and point them at the new folders.

Upvotes: 0

Related Questions