Re: date-time info at compile time
Re: date-time info at compile time
- Subject: Re: date-time info at compile time
- From: "Ray, Jeffrey R. {Jeff}(DFRC-ME)" <email@hidden>
- Date: Thu, 14 May 2009 20:10:45 -0500
- Acceptlanguage: en-US
- Thread-topic: date-time info at compile time
On 5/14/09 4:16 PM, "Paul M" <email@hidden> wrote:
> I have a Makefile which generates a date-time spec when it runs, and
> passes that into my code as a #Define, thereby allowing me to
> automaticaly include build info in the executable.
>
> I'd like to find a way to do this from within XCode.
We had to do something similar. I didn't know xcode very well (still don't,
actually) so my solution may seem a bit convoluted.
I created a header, which extern's the date and time statements. This gets
included where necessary.
I created a target, and added to that target a run script phase. In this
script, I put a bunch of setenv commands to simulate the variable from the
makefile. It then ran an external script file (common to all the unix
platforms my app runs on), which generates a .cpp containing the actual
date/time statements.
I created a second target, dependant on the first. It compiles the .cpp
I added the resulting .o to my app(s).
This is rather convoluted because I had to use the same timestamp in
multiple targets, and it was reasonable to do a makeclean each time i wanted
a new timestamp. With a bit of thought, it can probably be
simplified/improved considerably for your purpose.
-jrr
_______________________________________________
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