[cmake-developers] patch for cmake that adds a new timestamp command

Nils Gladitz gladitz at sci-vis.de
Fri Oct 5 16:16:47 EDT 2012


I've updated the patch (attached) to return empty string on failure.
I also tried to use the time definitions from global namespace rather 
than std::.

Nils

On 10/05/2012 09:17 PM, Brad King wrote:
> On 10/05/2012 02:53 PM, Nils Gladitz wrote:
>> My initial thought was that "NOTFOUND" would be a good idea since it
>> evaluates to false and the get_*_property commands also seem to use it.
> I wrote the more general "get_property" command to replace those and
> the newer command uses empty string rather than NOTFOUND.  It is more
> useful when computing pieces of a string to put together, perhaps when
> appending to a property value.
>
>> Looking at the documentation for "if()" again only "-NOTFOUND" as a
>> suffix should evaluate to false though (I assume the documentation is
>> incomplete here?).
> Yes, thanks for pointing it out.  Fixed:
>
>   http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f63304d9
>
>> On second though relying on timestamps to evaluate to false on failure
>> is probably a bad idea since I could have a format string of e.g. "%w"
>> (day of the week) which might produce a valid timestamp "0" which would
>> also evaluate to false.
> Yes, so a comparison against "" would be more reliable.
>
> Thanks,
> -Brad


-- 
Nils Gladitz, B.Sc.
DICOM, Konnektivität und Entwicklung

Scivis wissenschaftliche Bildverarbeitung GmbH
Bertha-von-Suttner-Str. 5
D-37085 Göttingen
GERMANY
Handelsregister Nr. / Trade Register No. B3100 Göttingen
Geschäftsführer / Managing Directors Dr. Gernot Ebel, Dr. Uwe Engeland

Tel: 0049 (0)551 634181-28
E-Mail: gladitz at scivis.de
Web: www.scivis.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-timestamp-sub-command-for-string-and-file.patch
Type: text/x-patch
Size: 25933 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20121005/5fc366f3/attachment-0001.bin>


More information about the cmake-developers mailing list