[CMake] How best to capture the current Date/Time

Philip Lowman philip at yhbt.com
Fri Mar 20 18:01:44 EDT 2009


Another argument for a command is that the user may want...

Military time (24 hr)
UTC instead of local timezone
Months/Dates/Hours with leading 0's

By making it a command it is extensible and customizable.  If it's a set of 
variables you've already limited some of your options.

...... Original Message .......
On Fri, 20 Mar 2009 10:34:43 -0400 "Bill Hoffman" 
<bill.hoffman at kitware.com> wrote:
>Michael Jackson wrote:
>
>>> I don't think you could do this as a set of variables.  It would be 
>>> better as some sort of command.  file(GETDATE result) or something.
>>>
>>> -Bill
>> 
>> Well, I could but I am really interested in _why_ I would _not_ want to? 
>> Besides the obvious that the variables would basically change every time 
>> that cmake ran which might have some unwanted side effects.
>> 
>
>That would be the problem.  The would be variables that would change 
>with ever access, it would be very "special" code to handle that.  A 
>command that returns the date is very easy and "normal" to implement.
>
>-Bill
>_______________________________________________
>Powered by www.kitware.com
>
>Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html
>
>Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ
>
>Follow this link to subscribe/unsubscribe:
>http://www.cmake.org/mailman/listinfo/cmake
-- 
Philip Lowman


More information about the CMake mailing list