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

Nils Gladitz gladitz at sci-vis.de
Fri Oct 5 14:53:29 EDT 2012


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.
Looking at the documentation for "if()" again only "-NOTFOUND" as a 
suffix should evaluate to false though (I assume the documentation is 
incomplete here?).

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.

Nils

On 10/05/2012 07:34 PM, Brad King wrote:
> On 09/29/2012 05:47 AM, Nils Gladitz wrote:
>> I've updated the patch (attached) to include a "TIMESTAMP" sub-command
>> for "file" as well (I hope indentation is also fixed).
> Thanks.
>
> Use of std::time_t and std::tm will not compile on all of CMake's platforms.
> Other code already uses "#include <time.h>", "time_t", and "struct tm".
>
> Also, IMO the result in the case of failure should be the empty string
> rather than NOTFOUND.  The latter is a convention in the find_* commands
> that should never have been used elsewhere.
>
> 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




More information about the cmake-developers mailing list