Re: XCode documentation index; executable runtime paths
Re: XCode documentation index; executable runtime paths
- Subject: Re: XCode documentation index; executable runtime paths
- From: Mike Lazear <email@hidden>
- Date: Wed, 9 Mar 2005 09:57:09 -0800
On Mar 8, 2005, at 7:20 PM, Philip Lamb wrote:
On 09/03/2005, at 3:38 PM, Mike Lazear wrote:
On Mar 8, 2005, at 6:17 PM, Philip Lamb wrote:
Hi all,
Another question I have had for a long time; in one of my projects I have an executable which has to be built to a path outside the build directory.. actually, it is built into a bin/ subdiretory off the projcet root directory. Now, when it comes time to run the executable, I have no way of telling XCode to set the working directory to the executable's directory before it runs it.. the only options are "Project directory", "Build directory" and "Absolute path". The latter works, but only on my machine, so everyone I give the project to I have to explain how to edit the runtime path..which is quite well buried. So anyone know of a way to ask XCode to use a relative path (from the prject root or whatever) for the working directory of an executable?
In Xcode there are paths associated with the project, paths associated with targets and paths associated with executables. Since the only one that I see mention working directories is the paths associated with executables I'll assume those are the ones you are talking about. I would think the best solution would be to use a "Custom path".
In XCode 1.5
Select Project, Edit Active Executable '<appname>'
Select the General tab at the top
On the Select working directory question select "Custom directory"
Enter something like:
~/LIbrary/Application Support/AppName
The ~ equates to the users directory in my case /Users/Mike
I'm not sure where you want your working directory but hopefully that gives you something to start with.
Mike
Mike,
Correct, I am referring to paths for executables. The strategy you outlined is what I have been doing so far. However, this breaks if the user to whom I send the project file puts it in a different place in their home folder.
What I am looking for is something along the lines of a symbol that XCode will interpret and replace with (for example) the project root, so that I can build an executable working directory specification by appending some sub-folder name. For example, I tried using $SYMROOT/bin, but XCode doesn't recognise SYMROOT (or any other symbols, it seems) in the executable path spec.
Here are another 2 to try:
$(PROJECT_DIR)
$(SRCROOT)
I'm not quite sure what you need to do with the working directory. The code can always be written to find your unchanging data files within the bundle of your application, thus it doesn't matter where the executable is located. This is done with code in the program and not some setting in Xcode. As far as data files you create they should never go in the folder where your application is located. They should go in the users folder as described previously. So the first question is what kind of file are you trying to create and where does it really belong?
I know this has been mostly an Xcode question but are your writing in Cocoa or Carbon? Is this a command-line type app or does it have a user interface?
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden