9

I'm trying to port over a project I initially wrote in Windows to OS X and am having some difficulty with the header search paths.

I've used user search paths to include by source folder "project/src/core/" Under core, I have, for example: "projects/src/core/sys/sys_sdl.h" which tries to include "projects/src/core/render/opengl_render.h" with the directive:

#include "render/opengl_render.h"

I've tried tons of different options, but I can't get seem to get Xcode to find the file unless I change it to "../render/opengl_render.h"

Is there something I'm missing here in the settings to get it to recognize relative paths to the header search paths?

Regexident
  • 29,441
  • 10
  • 93
  • 100
meatfork
  • 91
  • 1
  • 2
  • And this relative solution fails if you have a header at another folder (let's say projects/gui/...) because than the relative path is wrong over there. :-( – Kay Apr 21 '11 at 19:08

1 Answers1

6

Did you try setting the User Header Search Path to $SRCROOT/..? $SRCROOT is the directory that contains the target's source files, so $SRCROOT/.. should be the directory above that, which I think is what you want.

A related question (How do I print a list of "Build Settings" in Xcode project?) shows a useful command that makes it easy to see all the build settings and the variables they modify:

$ xcodebuild -project myProj.xcodeproj -target "myTarg" -showBuildSettings
Community
  • 1
  • 1
Caleb
  • 124,013
  • 19
  • 183
  • 272
  • How the heck would you know this, though? Why don't they just have a pop-up menu that has all the possible wildcards? And how's this different from doing $(PROJECT) – CommaToast Mar 05 '14 at 10:05
  • I think PROJECT is just the name of the project itself, whereas SRCROOT is the path to the target's source files. As for why there's not a popup, it's probably a combination of preserving flexibility (you need to be able to specify any path) and it not adding enough value to make it a priority. Also, see my edit above. – Caleb Mar 05 '14 at 15:40