tags:

views:

40

answers:

2

I managed to get my C++ project running in Xcode using cmake -G Xcode. Now I would like to debug it, because of the nice gdb fronted it provides.

However I need to change the working directory where gdb is executed otherwise it wont work. (It needs to read some data from files relative to the path of the working directory) What I can do is after gdb has stopped typing cd working_dir and then run it manually typing r. This works, but Xcode will complain constantly and is also not an elegant solution.

So somewhere in the build settings I should be able to set the working directory..but where?!

A: 

Try to include working directory in xcode project. Usually this will copy all files in the application bundle and will solve path problems.

Felics
+1  A: 

In Xcode do a "Get Info" on the executable and look at the first tab - there is a setting there for working directory.

Paul R
How could I oversee that? I was looking at the target properties.. thanks!
Nils
No problem - it's easy to get mixed up between the target settings and the executable settings - I do this all the time and I've been using Xcode for *years*.
Paul R