Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode 4 Relative #include paths in search?

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?

like image 609
meatfork Avatar asked Apr 13 '11 03:04

meatfork


1 Answers

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
like image 97
Caleb Avatar answered Oct 16 '22 22:10

Caleb