• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: date-time info at compile time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date-time info at compile time


  • Subject: Re: date-time info at compile time
  • From: Peter O'Gorman <email@hidden>
  • Date: Thu, 14 May 2009 20:49:56 -0500

Ray, Jeffrey R. {Jeff}(DFRC-ME) wrote:
> 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).

Probably stupid question:
Why not just use the __DATE__ and __TIME__ macros?

Peter
--
Peter O'Gorman
http://pogma.com
 _______________________________________________
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

  • Follow-Ups:
    • Re: date-time info at compile time
      • From: "Ray, Jeffrey R. {Jeff}(DFRC-ME)" <email@hidden>
    • Re: date-time info at compile time
      • From: Paul M <email@hidden>
References: 
 >Re: date-time info at compile time (From: "Ray, Jeffrey R. {Jeff}(DFRC-ME)" <email@hidden>)

  • Prev by Date: creating a project with three connected sub projects.
  • Next by Date: date-time info at compile time
  • Previous by thread: Re: date-time info at compile time
  • Next by thread: Re: date-time info at compile time
  • Index(es):
    • Date
    • Thread