[cmake-developers] patch for cmake that adds a new timestamp command
Brad King
brad.king at kitware.com
Fri Oct 5 15:17:46 EDT 2012
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
More information about the cmake-developers
mailing list