Sunday, May 24, 2009

Programming: Including src folder into XCode Project

So recently, I'm trying to include BulletPhysics into my XCode project. Apparently, I got no luck in CMake and got fancy errors. So I try to just include the src folders into my project. I did this by drag-and-drop the src folder into my project (check the topmost copy, and create folder recursively). The problem is when I try to include one of the file, there were errors since XCode wont search for folders. If you notice when you're trying to code in XCode, you won't be able to create a folder, just bunch of groups. Included file in a folders eg "myFolder/myFile.cpp" won't be noticed. 

Here is the solution:

1. Right click your project, pick "Get Info"
2. Find "Header Search Paths" under "Search Paths" tab. Double click the field
3. Click the "+" button to add new folder, check Recursive, and enter the folder you've dragged to your project.

 Thats all. Next time you download an open source file, just drag the "src" folder into your project, rename the folder so it won't conflict with other file, and do the same thing. 

I just download BulletPhysics, drag the "src" folder to my project, rename it to bulletPhysic, do the steps above and it works. This is the screenshot after doing the steps above. Hope it helps ;)

No comments: