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

2012-11-02 Thread Nils Gladitz

Thanks!

Let me know if there is anything else I can do.

Nils

On 10/31/2012 09:52 PM, David Cole wrote:
Has anybody tried this anywhere else? I'm going to merge it to 'next' 
tomorrow, so that it will get tested on the dashboards after that. 
Just curious if there are any other known problems with it that I 
should squash in before doing that...


Thanks,
David



On Tue, Oct 16, 2012 at 1:57 PM, David Cole david.c...@kitware.com 
mailto:david.c...@kitware.com wrote:


I have amended the commit and pushed this branch to the stage. If
anybody else would like to try it out they can grab the
add-timestamp-subcommands branch from the CMake stage repo.

I did not merge it to 'next' yet, but I will do that when we're ready
to get it tested on the dashboards.

Thanks for your work on this Nils.


David


On Tue, Oct 16, 2012 at 11:48 AM, Nils Gladitz glad...@sci-vis.de
mailto:glad...@sci-vis.de wrote:
 Ah that might explain it ... I may have been using nmake on
Windows and
 ninja on linux.
 Thanks!

 Nils


 On 10/16/2012 05:27 PM, David Cole wrote:

 On Tue, Oct 16, 2012 at 10:12 AM, Nils Gladitz
glad...@sci-vis.de mailto:glad...@sci-vis.de wrote:

 I certainly wouldn't mind though I'm not sure what that means.
 Do the changes in next still potentially make it into 2.8.10?

 Going into 'next' is how stuff gets tested on the dashboards,
and then
 later Brad and I merge things to 'master' when they're ready.

 After something is merged to 'master' it will be in the CMake
release
 that follows that.


 Brad mentioned this would be on the TODO list for after 2.8.10.

 We can put it in 'next' to vet it and correct any dashboard issues
 that show up (errors/warnings on other platforms, other
platform test
 failures) at any time. But it will probably not go into
'master' until
 after 2.8.10.

 We don't typically add significant features or take risky changes
 after we start doing release candidates.


 I've tried to run all tests successfully before submitting but
I can't
 tell
 if any of those were called BootstrapTest.
 Is there anything special required to run it?

 The BootstrapTest test only runs on Unix Makefiles based
builds, so
 if you're using a different generator, it does not get added as a
 test.


 Nils


 On 10/16/2012 02:49 PM, David Cole wrote:

 I had to do this to get the bootstrap version of CMake to
work (and
 the BootstrapTest to pass):

 $ git diff
 diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
 index 9d46355..8bf6c40 100644
 --- a/Source/CMakeLists.txt
 +++ b/Source/CMakeLists.txt
 @@ -264,8 +264,6 @@ set(SRCS
  cmTarget.cxx
  cmTarget.h
  cmTargetExport.h
 -  cmTimestamp.h
 -  cmTimestamp.cxx
  cmTest.cxx
  cmTest.h
  cmTestGenerator.cxx
 diff --git a/Source/cmBootstrapCommands.cxx
 b/Source/cmBootstrapCommands.cxx
 index 9097a74..e3a2ad4 100644
 --- a/Source/cmBootstrapCommands.cxx
 +++ b/Source/cmBootstrapCommands.cxx
 @@ -89,6 +89,7 @@
#include cmStringCommand.cxx
#include cmSubdirCommand.cxx
#include cmTargetLinkLibrariesCommand.cxx
 +#include cmTimestamp.cxx
#include cmTryCompileCommand.cxx
#include cmTryRunCommand.cxx
#include cmUnsetCommand.cxx


 After amending this, I'll push to next later today unless
somebody
 objects to this??

 Thanks,
 David



 On Fri, Oct 5, 2012 at 4:16 PM, Nils Gladitz
glad...@sci-vis.de mailto:glad...@sci-vis.de wrote:

 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 

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

2012-11-02 Thread David Cole
You're welcome. I decided to wait till the dashboard cleans up again
before merging this topic, but it should be in the next few days.

On Fri, Nov 2, 2012 at 10:19 AM, Nils Gladitz glad...@sci-vis.de wrote:
 Thanks!

 Let me know if there is anything else I can do.

 Nils


 On 10/31/2012 09:52 PM, David Cole wrote:

 Has anybody tried this anywhere else? I'm going to merge it to 'next'
 tomorrow, so that it will get tested on the dashboards after that. Just
 curious if there are any other known problems with it that I should squash
 in before doing that...

 Thanks,
 David



 On Tue, Oct 16, 2012 at 1:57 PM, David Cole david.c...@kitware.com wrote:

 I have amended the commit and pushed this branch to the stage. If
 anybody else would like to try it out they can grab the
 add-timestamp-subcommands branch from the CMake stage repo.

 I did not merge it to 'next' yet, but I will do that when we're ready
 to get it tested on the dashboards.

 Thanks for your work on this Nils.


 David


 On Tue, Oct 16, 2012 at 11:48 AM, Nils Gladitz glad...@sci-vis.de wrote:
  Ah that might explain it ... I may have been using nmake on Windows and
  ninja on linux.
  Thanks!
 
  Nils
 
 
  On 10/16/2012 05:27 PM, David Cole wrote:
 
  On Tue, Oct 16, 2012 at 10:12 AM, Nils Gladitz glad...@sci-vis.de
  wrote:
 
  I certainly wouldn't mind though I'm not sure what that means.
  Do the changes in next still potentially make it into 2.8.10?
 
  Going into 'next' is how stuff gets tested on the dashboards, and then
  later Brad and I merge things to 'master' when they're ready.
 
  After something is merged to 'master' it will be in the CMake release
  that follows that.
 
 
  Brad mentioned this would be on the TODO list for after 2.8.10.
 
  We can put it in 'next' to vet it and correct any dashboard issues
  that show up (errors/warnings on other platforms, other platform test
  failures) at any time. But it will probably not go into 'master' until
  after 2.8.10.
 
  We don't typically add significant features or take risky changes
  after we start doing release candidates.
 
 
  I've tried to run all tests successfully before submitting but I can't
  tell
  if any of those were called BootstrapTest.
  Is there anything special required to run it?
 
  The BootstrapTest test only runs on Unix Makefiles based builds, so
  if you're using a different generator, it does not get added as a
  test.
 
 
  Nils
 
 
  On 10/16/2012 02:49 PM, David Cole wrote:
 
  I had to do this to get the bootstrap version of CMake to work (and
  the BootstrapTest to pass):
 
  $ git diff
  diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
  index 9d46355..8bf6c40 100644
  --- a/Source/CMakeLists.txt
  +++ b/Source/CMakeLists.txt
  @@ -264,8 +264,6 @@ set(SRCS
   cmTarget.cxx
   cmTarget.h
   cmTargetExport.h
  -  cmTimestamp.h
  -  cmTimestamp.cxx
   cmTest.cxx
   cmTest.h
   cmTestGenerator.cxx
  diff --git a/Source/cmBootstrapCommands.cxx
  b/Source/cmBootstrapCommands.cxx
  index 9097a74..e3a2ad4 100644
  --- a/Source/cmBootstrapCommands.cxx
  +++ b/Source/cmBootstrapCommands.cxx
  @@ -89,6 +89,7 @@
 #include cmStringCommand.cxx
 #include cmSubdirCommand.cxx
 #include cmTargetLinkLibrariesCommand.cxx
  +#include cmTimestamp.cxx
 #include cmTryCompileCommand.cxx
 #include cmTryRunCommand.cxx
 #include cmUnsetCommand.cxx
 
 
  After amending this, I'll push to next later today unless
  somebody
  objects to this??
 
  Thanks,
  David
 
 
 
  On Fri, Oct 5, 2012 at 4:16 PM, Nils Gladitz glad...@sci-vis.de
  wrote:
 
  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 

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

2012-10-31 Thread David Cole
Has anybody tried this anywhere else? I'm going to merge it to 'next'
tomorrow, so that it will get tested on the dashboards after that. Just
curious if there are any other known problems with it that I should squash
in before doing that...

Thanks,
David



On Tue, Oct 16, 2012 at 1:57 PM, David Cole david.c...@kitware.com wrote:

 I have amended the commit and pushed this branch to the stage. If
 anybody else would like to try it out they can grab the
 add-timestamp-subcommands branch from the CMake stage repo.

 I did not merge it to 'next' yet, but I will do that when we're ready
 to get it tested on the dashboards.

 Thanks for your work on this Nils.


 David


 On Tue, Oct 16, 2012 at 11:48 AM, Nils Gladitz glad...@sci-vis.de wrote:
  Ah that might explain it ... I may have been using nmake on Windows and
  ninja on linux.
  Thanks!
 
  Nils
 
 
  On 10/16/2012 05:27 PM, David Cole wrote:
 
  On Tue, Oct 16, 2012 at 10:12 AM, Nils Gladitz glad...@sci-vis.de
 wrote:
 
  I certainly wouldn't mind though I'm not sure what that means.
  Do the changes in next still potentially make it into 2.8.10?
 
  Going into 'next' is how stuff gets tested on the dashboards, and then
  later Brad and I merge things to 'master' when they're ready.
 
  After something is merged to 'master' it will be in the CMake release
  that follows that.
 
 
  Brad mentioned this would be on the TODO list for after 2.8.10.
 
  We can put it in 'next' to vet it and correct any dashboard issues
  that show up (errors/warnings on other platforms, other platform test
  failures) at any time. But it will probably not go into 'master' until
  after 2.8.10.
 
  We don't typically add significant features or take risky changes
  after we start doing release candidates.
 
 
  I've tried to run all tests successfully before submitting but I can't
  tell
  if any of those were called BootstrapTest.
  Is there anything special required to run it?
 
  The BootstrapTest test only runs on Unix Makefiles based builds, so
  if you're using a different generator, it does not get added as a
  test.
 
 
  Nils
 
 
  On 10/16/2012 02:49 PM, David Cole wrote:
 
  I had to do this to get the bootstrap version of CMake to work (and
  the BootstrapTest to pass):
 
  $ git diff
  diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
  index 9d46355..8bf6c40 100644
  --- a/Source/CMakeLists.txt
  +++ b/Source/CMakeLists.txt
  @@ -264,8 +264,6 @@ set(SRCS
   cmTarget.cxx
   cmTarget.h
   cmTargetExport.h
  -  cmTimestamp.h
  -  cmTimestamp.cxx
   cmTest.cxx
   cmTest.h
   cmTestGenerator.cxx
  diff --git a/Source/cmBootstrapCommands.cxx
  b/Source/cmBootstrapCommands.cxx
  index 9097a74..e3a2ad4 100644
  --- a/Source/cmBootstrapCommands.cxx
  +++ b/Source/cmBootstrapCommands.cxx
  @@ -89,6 +89,7 @@
 #include cmStringCommand.cxx
 #include cmSubdirCommand.cxx
 #include cmTargetLinkLibrariesCommand.cxx
  +#include cmTimestamp.cxx
 #include cmTryCompileCommand.cxx
 #include cmTryRunCommand.cxx
 #include cmUnsetCommand.cxx
 
 
  After amending this, I'll push to next later today unless somebody
  objects to this??
 
  Thanks,
  David
 
 
 
  On Fri, Oct 5, 2012 at 4:16 PM, Nils Gladitz glad...@sci-vis.de
 wrote:
 
  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: glad...@scivis.de
  Web: www.scivis.de
 
 
  --
 
  Powered by www.kitware.com
 
  Visit other Kitware 

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

2012-10-16 Thread David Cole
I had to do this to get the bootstrap version of CMake to work (and
the BootstrapTest to pass):

$ git diff
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 9d46355..8bf6c40 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -264,8 +264,6 @@ set(SRCS
   cmTarget.cxx
   cmTarget.h
   cmTargetExport.h
-  cmTimestamp.h
-  cmTimestamp.cxx
   cmTest.cxx
   cmTest.h
   cmTestGenerator.cxx
diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index 9097a74..e3a2ad4 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -89,6 +89,7 @@
 #include cmStringCommand.cxx
 #include cmSubdirCommand.cxx
 #include cmTargetLinkLibrariesCommand.cxx
+#include cmTimestamp.cxx
 #include cmTryCompileCommand.cxx
 #include cmTryRunCommand.cxx
 #include cmUnsetCommand.cxx


After amending this, I'll push to next later today unless somebody
objects to this??

Thanks,
David



On Fri, Oct 5, 2012 at 4:16 PM, Nils Gladitz glad...@sci-vis.de wrote:
 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: glad...@scivis.de
 Web: www.scivis.de


 --

 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-10-16 Thread Nils Gladitz

I certainly wouldn't mind though I'm not sure what that means.
Do the changes in next still potentially make it into 2.8.10?

Brad mentioned this would be on the TODO list for after 2.8.10.

I've tried to run all tests successfully before submitting but I can't 
tell if any of those were called BootstrapTest.

Is there anything special required to run it?

Nils

On 10/16/2012 02:49 PM, David Cole wrote:

I had to do this to get the bootstrap version of CMake to work (and
the BootstrapTest to pass):

$ git diff
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 9d46355..8bf6c40 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -264,8 +264,6 @@ set(SRCS
cmTarget.cxx
cmTarget.h
cmTargetExport.h
-  cmTimestamp.h
-  cmTimestamp.cxx
cmTest.cxx
cmTest.h
cmTestGenerator.cxx
diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index 9097a74..e3a2ad4 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -89,6 +89,7 @@
  #include cmStringCommand.cxx
  #include cmSubdirCommand.cxx
  #include cmTargetLinkLibrariesCommand.cxx
+#include cmTimestamp.cxx
  #include cmTryCompileCommand.cxx
  #include cmTryRunCommand.cxx
  #include cmUnsetCommand.cxx


After amending this, I'll push to next later today unless somebody
objects to this??

Thanks,
David



On Fri, Oct 5, 2012 at 4:16 PM, Nils Gladitz glad...@sci-vis.de wrote:

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: glad...@scivis.de
Web: www.scivis.de


--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



--
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: glad...@scivis.de
Web: www.scivis.de

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-10-16 Thread David Cole
On Tue, Oct 16, 2012 at 10:12 AM, Nils Gladitz glad...@sci-vis.de wrote:
 I certainly wouldn't mind though I'm not sure what that means.
 Do the changes in next still potentially make it into 2.8.10?


Going into 'next' is how stuff gets tested on the dashboards, and then
later Brad and I merge things to 'master' when they're ready.

After something is merged to 'master' it will be in the CMake release
that follows that.


 Brad mentioned this would be on the TODO list for after 2.8.10.


We can put it in 'next' to vet it and correct any dashboard issues
that show up (errors/warnings on other platforms, other platform test
failures) at any time. But it will probably not go into 'master' until
after 2.8.10.

We don't typically add significant features or take risky changes
after we start doing release candidates.


 I've tried to run all tests successfully before submitting but I can't tell
 if any of those were called BootstrapTest.
 Is there anything special required to run it?


The BootstrapTest test only runs on Unix Makefiles based builds, so
if you're using a different generator, it does not get added as a
test.


 Nils


 On 10/16/2012 02:49 PM, David Cole wrote:

 I had to do this to get the bootstrap version of CMake to work (and
 the BootstrapTest to pass):

 $ git diff
 diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
 index 9d46355..8bf6c40 100644
 --- a/Source/CMakeLists.txt
 +++ b/Source/CMakeLists.txt
 @@ -264,8 +264,6 @@ set(SRCS
 cmTarget.cxx
 cmTarget.h
 cmTargetExport.h
 -  cmTimestamp.h
 -  cmTimestamp.cxx
 cmTest.cxx
 cmTest.h
 cmTestGenerator.cxx
 diff --git a/Source/cmBootstrapCommands.cxx
 b/Source/cmBootstrapCommands.cxx
 index 9097a74..e3a2ad4 100644
 --- a/Source/cmBootstrapCommands.cxx
 +++ b/Source/cmBootstrapCommands.cxx
 @@ -89,6 +89,7 @@
   #include cmStringCommand.cxx
   #include cmSubdirCommand.cxx
   #include cmTargetLinkLibrariesCommand.cxx
 +#include cmTimestamp.cxx
   #include cmTryCompileCommand.cxx
   #include cmTryRunCommand.cxx
   #include cmUnsetCommand.cxx


 After amending this, I'll push to next later today unless somebody
 objects to this??

 Thanks,
 David



 On Fri, Oct 5, 2012 at 4:16 PM, Nils Gladitz glad...@sci-vis.de wrote:

 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: glad...@scivis.de
 Web: www.scivis.de


 --

 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



 --
 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: glad...@scivis.de
 Web: www.scivis.de

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-10-16 Thread Nils Gladitz
Ah that might explain it ... I may have been using nmake on Windows and 
ninja on linux.

Thanks!

Nils

On 10/16/2012 05:27 PM, David Cole wrote:

On Tue, Oct 16, 2012 at 10:12 AM, Nils Gladitz glad...@sci-vis.de wrote:

I certainly wouldn't mind though I'm not sure what that means.
Do the changes in next still potentially make it into 2.8.10?


Going into 'next' is how stuff gets tested on the dashboards, and then
later Brad and I merge things to 'master' when they're ready.

After something is merged to 'master' it will be in the CMake release
that follows that.



Brad mentioned this would be on the TODO list for after 2.8.10.


We can put it in 'next' to vet it and correct any dashboard issues
that show up (errors/warnings on other platforms, other platform test
failures) at any time. But it will probably not go into 'master' until
after 2.8.10.

We don't typically add significant features or take risky changes
after we start doing release candidates.



I've tried to run all tests successfully before submitting but I can't tell
if any of those were called BootstrapTest.
Is there anything special required to run it?


The BootstrapTest test only runs on Unix Makefiles based builds, so
if you're using a different generator, it does not get added as a
test.



Nils


On 10/16/2012 02:49 PM, David Cole wrote:

I had to do this to get the bootstrap version of CMake to work (and
the BootstrapTest to pass):

$ git diff
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 9d46355..8bf6c40 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -264,8 +264,6 @@ set(SRCS
 cmTarget.cxx
 cmTarget.h
 cmTargetExport.h
-  cmTimestamp.h
-  cmTimestamp.cxx
 cmTest.cxx
 cmTest.h
 cmTestGenerator.cxx
diff --git a/Source/cmBootstrapCommands.cxx
b/Source/cmBootstrapCommands.cxx
index 9097a74..e3a2ad4 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -89,6 +89,7 @@
   #include cmStringCommand.cxx
   #include cmSubdirCommand.cxx
   #include cmTargetLinkLibrariesCommand.cxx
+#include cmTimestamp.cxx
   #include cmTryCompileCommand.cxx
   #include cmTryRunCommand.cxx
   #include cmUnsetCommand.cxx


After amending this, I'll push to next later today unless somebody
objects to this??

Thanks,
David



On Fri, Oct 5, 2012 at 4:16 PM, Nils Gladitz glad...@sci-vis.de wrote:

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: glad...@scivis.de
Web: www.scivis.de


--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



--
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: glad...@scivis.de
Web: www.scivis.de




--
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: glad...@scivis.de
Web: www.scivis.de


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

2012-10-05 Thread Nils Gladitz
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: glad...@scivis.de
Web: www.scivis.de

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

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

2012-10-05 Thread Brad King
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
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-09-29 Thread Nils Gladitz
I've updated the patch (attached) to include a TIMESTAMP sub-command 
for file as well (I hope indentation is also fixed).


I only implemented the last modification time since creation and last 
access time are not implemented by all filesystems (or disabled for 
performance).


Nils
From fdd3bd749b85ecff1d07e6f735417d8bad1e70c4 Mon Sep 17 00:00:00 2001
From: Nils Gladitz glad...@scivis.de
Date: Sat, 29 Sep 2012 11:31:18 +0200
Subject: [PATCH] timestamp sub-command for string and file

---
 Source/CMakeLists.txt  |2 +
 Source/cmFileCommand.cxx   |   57 
 Source/cmFileCommand.h |   10 ++
 Source/cmStringCommand.cxx |   54 
 Source/cmStringCommand.h   |   30 -
 Source/cmTimestamp.cxx |  135 
 Source/cmTimestamp.h   |   42 ++
 Tests/CMakeTests/File-TIMESTAMP-BadArg1.cmake  |1 +
 Tests/CMakeTests/File-TIMESTAMP-NoFile.cmake   |2 +
 Tests/CMakeTests/File-TIMESTAMP-NotBogus.cmake |   24 
 Tests/CMakeTests/File-TIMESTAMP-Works.cmake|2 +
 Tests/CMakeTests/FileTest.cmake.in |   12 ++
 .../String-TIMESTAMP-AllSpecifiers.cmake   |   11 ++
 Tests/CMakeTests/String-TIMESTAMP-BadArg1.cmake|1 +
 Tests/CMakeTests/String-TIMESTAMP-BadArg2.cmake|1 +
 Tests/CMakeTests/String-TIMESTAMP-BadArg3.cmake|1 +
 .../String-TIMESTAMP-CustomFormatLocal.cmake   |2 +
 .../String-TIMESTAMP-CustomFormatUTC.cmake |2 +
 .../String-TIMESTAMP-DefaulFormatUTC.cmake |2 +
 .../String-TIMESTAMP-DefaultFormatLocal.cmake  |2 +
 .../String-TIMESTAMP-DefaultFormatUTC.cmake|2 +
 .../String-TIMESTAMP-IncompleteSpecifier.cmake |2 +
 .../String-TIMESTAMP-UnknownSpecifier.cmake|2 +
 Tests/CMakeTests/StringTest.cmake.in   |   30 +
 24 files changed, 428 insertions(+), 1 deletions(-)
 create mode 100644 Source/cmTimestamp.cxx
 create mode 100644 Source/cmTimestamp.h
 create mode 100644 Tests/CMakeTests/File-TIMESTAMP-BadArg1.cmake
 create mode 100644 Tests/CMakeTests/File-TIMESTAMP-NoFile.cmake
 create mode 100644 Tests/CMakeTests/File-TIMESTAMP-NotBogus.cmake
 create mode 100644 Tests/CMakeTests/File-TIMESTAMP-Works.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-AllSpecifiers.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-BadArg1.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-BadArg2.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-BadArg3.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-CustomFormatLocal.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-CustomFormatUTC.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-DefaulFormatUTC.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-DefaultFormatLocal.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-DefaultFormatUTC.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-IncompleteSpecifier.cmake
 create mode 100644 Tests/CMakeTests/String-TIMESTAMP-UnknownSpecifier.cmake

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 5a3e7d1..00a1a0a 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -259,6 +259,8 @@ set(SRCS
   cmSystemTools.h
   cmTarget.cxx
   cmTarget.h
+  cmTimestamp.h
+  cmTimestamp.cxx
   cmTest.cxx
   cmTest.h
   cmTestGenerator.cxx
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 8de24b3..3b074da 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -17,6 +17,8 @@
 #include cmFileTimeComparison.h
 #include cmCryptoHash.h
 
+#include cmTimestamp.h
+
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 #include cm_curl.h
 #endif
@@ -160,6 +162,10 @@ bool cmFileCommand
 {
 return this-HandleCMakePathCommand(args, true);
 }
+  else if ( subCommand == TIMESTAMP )
+{
+return this-HandleTimestampCommand(args);
+}
 
   std::string e = does not recognize sub-command +subCommand;
   this-SetError(e.c_str());
@@ -3246,3 +3252,54 @@ cmFileCommand::HandleUploadCommand(std::vectorstd::string const args)
   return false;
 #endif
 }
+
+//
+bool cmFileCommand::HandleTimestampCommand(
+  std::vectorstd::string const args)
+{
+  if(args.size()  3)
+{
+this-SetError(sub-command TIMESTAMP requires at least two arguments.);
+return false;
+}
+  else if(args.size()  5)
+{
+this-SetError(sub-command TIMESTAMP takes at most four arguments.);
+return false;
+}
+
+  int argsIndex = 1;
+
+  const std::string filename = args[argsIndex++];
+
+  const std::string outputVariable = args[argsIndex++];
+
+  std::string formatString;
+  if(args.size()  argsIndex  args[argsIndex] != UTC)
+{
+formatString = args[argsIndex++];
+}
+
+ 

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

2012-09-28 Thread Nils Gladitz

Why is TIMESTAMP misleading?

Per default it currently outputs year, month, day, hour, minute and second.
This includes both a date (a day on a calendar) as well as time (time of 
day).


Timestamp I'd define as both date and time bound to an event (here the 
call or the (sub-)command).


Date I'd consider inaccurate since it implies that there is no time 
resolution.


Time I'd say would be slightly more accurate since it has higher 
precision and it matches the naming in C (time_t, tm, strftime ...).


DateTime Is accurate and has precedence (e.g. SQL) but is (IMO) not as 
pretty.


To list them in order of personal preference this would for me give:
Timestamp, DateTime, Time, Date

Nils


On 09/27/2012 07:41 PM, Eric Noulard wrote:

2012/9/27 David Cole david.c...@kitware.com:

H. Good idea.

Should we add a new command for this? Or should it be a sub-command of
string( like RANDOM is?

And... while we're at it, I've always thought we should add the
ability to get the creation/modified/access times from a file via the
CMake file command. If we allow getting the current time, we should
leverage some of the same transformation-to-string code in the file
command to get the various times associated with a file.

What do other devs here think:
New command or string sub-command for this functionality?

string sub-command for me, and agreed with Brad as well
for the namespace thing.

agreed with file(...) extension as well.

that said isn't the TIMESTAMP misleading?
shouldn't it be called DATE instead?






--
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: glad...@scivis.de
Web: www.scivis.de

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-09-28 Thread David Cole
On Fri, Sep 28, 2012 at 2:28 AM, Nils Gladitz glad...@sci-vis.de wrote:

 Why is TIMESTAMP misleading?

 Per default it currently outputs year, month, day, hour, minute and second.
 This includes both a date (a day on a calendar) as well as time (time of
 day).

 Timestamp I'd define as both date and time bound to an event (here the
 call or the (sub-)command).

 Date I'd consider inaccurate since it implies that there is no time
 resolution.

 Time I'd say would be slightly more accurate since it has higher
 precision and it matches the naming in C (time_t, tm, strftime ...).

 DateTime Is accurate and has precedence (e.g. SQL) but is (IMO) not as
 pretty.

 To list them in order of personal preference this would for me give:
 Timestamp, DateTime, Time, Date

 Nils



 On 09/27/2012 07:41 PM, Eric Noulard wrote:

 2012/9/27 David Cole david.c...@kitware.com:

 H. Good idea.

 Should we add a new command for this? Or should it be a sub-command of
 string( like RANDOM is?

 And... while we're at it, I've always thought we should add the
 ability to get the creation/modified/access times from a file via the
 CMake file command. If we allow getting the current time, we should
 leverage some of the same transformation-to-string code in the file
 command to get the various times associated with a file.

 What do other devs here think:
 New command or string sub-command for this functionality?

 string sub-command for me, and agreed with Brad as well
 for the namespace thing.

 agreed with file(...) extension as well.

 that said isn't the TIMESTAMP misleading?
 shouldn't it be called DATE instead?





 --
 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: glad...@scivis.de
 Web: www.scivis.de

 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at http://www.kitware.com/**
 opensource/opensource.htmlhttp://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/**CMake_FAQhttp://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/cgi-**bin/mailman/listinfo/cmake-**developershttp://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



I agree with Nils here. I like Timestamp or DateTime best since it has
resolution down to (at least) the second.

Nils, we do not have a formal definition of coding style written out
anywhere.

To summarize our expectations briefly, though, I'd say this:

When modifying existing files, try to blend in with the existing style.
When editing C++ source or header files, keep line length under 80
characters per line. When adding a new file, copy the style from another
file nearby. With *.cmake files, please use lowercase commands. When
defining functions or macros in the CMake language, use ${FileName}_ as a
prefix for functions defined in a *.cmake file, where FileName.cmake is the
name of the containing file.

And ask questions here if there's anything that's unclear.

Thanks,
David
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

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

2012-09-28 Thread Rolf Eike Beer

Am 2012-09-28 08:44, schrieb Nils Gladitz:

Sorry about the indentation ... I've still got a bit of trouble
switching between coding conventions.


Yeah, kernel style is the only sane one ;)


On that note, are there documented coding conventions, coding
guidelines or similar somewhere?


My point here was that the code between some if's {} was at the same 
level as the if, at least on some places, but not on all.

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-09-27 Thread Nils Gladitz
I've tried creating a patch (attached; should apply to master) that adds 
a timestamp creation command.
It builds on strftime but only allows a limited number of conversion 
specifiers.
I tried to only allow those which are portable (C89), locale independent 
and of fixed range and length (with the exception of %Y).


Nils

--
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: glad...@scivis.de
Web: www.scivis.de

From d532bb916aedb3383472727d999d16e8302e9fdd Mon Sep 17 00:00:00 2001
From: Nils Gladitz glad...@scivis.de
Date: Thu, 27 Sep 2012 13:10:52 +0200
Subject: [PATCH] new timestamp command

---
 Source/cmBootstrapCommands.cxx  |2 +
 Source/cmTimestampCommand.cxx   |  147 +++
 Source/cmTimestampCommand.h |  107 ++
 Tests/CMakeTests/CMakeLists.txt |1 +
 Tests/CMakeTests/TimestampTest.cmake.in |   60 +
 5 files changed, 317 insertions(+)
 create mode 100644 Source/cmTimestampCommand.cxx
 create mode 100644 Source/cmTimestampCommand.h
 create mode 100644 Tests/CMakeTests/TimestampTest.cmake.in

diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index 9097a74..f651d37 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -89,6 +89,7 @@
 #include cmStringCommand.cxx
 #include cmSubdirCommand.cxx
 #include cmTargetLinkLibrariesCommand.cxx
+#include cmTimestampCommand.cxx
 #include cmTryCompileCommand.cxx
 #include cmTryRunCommand.cxx
 #include cmUnsetCommand.cxx
@@ -164,6 +165,7 @@ void GetBootstrapCommands(std::listcmCommand* commands)
   commands.push_back(new cmStringCommand);
   commands.push_back(new cmSubdirCommand);
   commands.push_back(new cmTargetLinkLibrariesCommand);
+  commands.push_back(new cmTimestampCommand);
   commands.push_back(new cmTryCompileCommand);
   commands.push_back(new cmTryRunCommand);
   commands.push_back(new cmUnsetCommand);
diff --git a/Source/cmTimestampCommand.cxx b/Source/cmTimestampCommand.cxx
new file mode 100644
index 000..0405026
--- /dev/null
+++ b/Source/cmTimestampCommand.cxx
@@ -0,0 +1,147 @@
+/*
+  CMake - Cross Platform Makefile Generator
+  Copyright 2012 Kitware, Inc., Insight Software Consortium
+
+  Distributed under the OSI-approved BSD License (the License);
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+*/
+#include cmTimestampCommand.h
+
+#include ctime
+#include cstring
+
+//
+namespace
+{
+  std::string AddTimestampComponent(char flag, std::tm timeStruct)
+  {
+std::string formatString = %;
+formatString += flag;
+
+switch(flag)
+{
+case 'd':
+case 'H':
+case 'I':
+case 'j':
+case 'm':
+case 'M':
+case 'S':
+case 'U':
+case 'w':
+case 'y':
+case 'Y':
+  break;
+default:
+  {
+return formatString;
+  }
+}
+
+char buffer[16];
+
+std::size_t size = std::strftime(buffer, sizeof(buffer),
+  formatString.c_str(), timeStruct);
+
+return std::string(buffer, size);
+  }
+}
+
+//
+bool cmTimestampCommand
+::InitialPass(std::vectorstd::string const args, cmExecutionStatus )
+{
+  if(args.size()  1)
+{
+this-SetError(must be called with at least one argument.);
+return false;
+}
+
+  const std::string outputVariable = args[0];
+
+  int index = 1;
+
+  std::string formatString;
+  if(args.size()  index  args[index] != UTC)
+  {
+formatString = args[index++];
+  }
+
+  bool utcFlag = false;
+  if(args.size()  index)
+  {
+if(args[index] == UTC)
+{
+  utcFlag = true;
+}
+else
+{
+  std::string e = does not recognize option  + args[index];
+  this-SetError(e.c_str());
+  return false;
+}
+  }
+
+  if(formatString.empty())
+  {
+  formatString = %Y-%m-%dT%H:%M:%S;
+  if(utcFlag) formatString += Z;
+  }
+
+  std::string timestamp = CreateTimestamp(formatString, utcFlag);
+  this-Makefile-AddDefinition(outputVariable.c_str(), timestamp.c_str());
+
+  return true;
+}
+
+//
+std::string cmTimestampCommand::CreateTimestamp(
+  const std::string formatString, bool utcFlag)
+{
+  std::string result;
+  const char* notFound 

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

2012-09-27 Thread Brad King
On 09/27/2012 08:37 AM, David Cole wrote:
 Should we add a new command for this? Or should it be a sub-command of
 string( like RANDOM is?

It should be a string(TIMESTAMP) subcommand.

-Brad
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-09-27 Thread Nils Gladitz

I wouldn't mind if this were a string subcommand.

Initially I wanted something like this to tag package filenames.

What gave me another push is this CMake test:
http://open.cdash.org/testDetails.php?test=160586053build=2583145

It seems to fail on my system because it relies on the US locale 
formatting of %DATE% and %TIME% (my test system has a german locale).


There are also these older mailing list posts asking for something similar:
http://www.cmake.org/pipermail/cmake/2009-March/027915.html
http://www.cmake.org/pipermail/cmake/2010-November/041030.html

It would be really cool to have fractions of seconds too but I'm not 
sure how to portably implement those.


Nils


On 09/27/2012 02:37 PM, David Cole wrote:

H. Good idea.

Should we add a new command for this? Or should it be a sub-command of
string( like RANDOM is?

And... while we're at it, I've always thought we should add the
ability to get the creation/modified/access times from a file via the
CMake file command. If we allow getting the current time, we should
leverage some of the same transformation-to-string code in the file
command to get the various times associated with a file.

What do other devs here think:
New command or string sub-command for this functionality?


Thanks,
David


On Thu, Sep 27, 2012 at 7:25 AM, Nils Gladitz glad...@sci-vis.de wrote:

I've tried creating a patch (attached; should apply to master) that adds a
timestamp creation command.
It builds on strftime but only allows a limited number of conversion
specifiers.
I tried to only allow those which are portable (C89), locale independent and
of fixed range and length (with the exception of %Y).

Nils

--
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: glad...@scivis.de
Web: www.scivis.de


--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



--
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: glad...@scivis.de
Web: www.scivis.de

--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-09-27 Thread Brad King
On 09/27/2012 08:59 AM, Brad King wrote:
 On 09/27/2012 08:37 AM, David Cole wrote:
 Should we add a new command for this? Or should it be a sub-command of
 string( like RANDOM is?
 
 It should be a string(TIMESTAMP) subcommand.

We haven't added any top-level commands since 2008.  At this point
there are so many projects with macros and functions out there we
probably cannot safely add any new names unless they are long or start
with cmake_.  Subcommands are easy though.  I tend to think of the
top-level commands like file and string as namespaces.

-Brad
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-09-27 Thread Eric Noulard
2012/9/27 David Cole david.c...@kitware.com:
 H. Good idea.

 Should we add a new command for this? Or should it be a sub-command of
 string( like RANDOM is?

 And... while we're at it, I've always thought we should add the
 ability to get the creation/modified/access times from a file via the
 CMake file command. If we allow getting the current time, we should
 leverage some of the same transformation-to-string code in the file
 command to get the various times associated with a file.

 What do other devs here think:
 New command or string sub-command for this functionality?

string sub-command for me, and agreed with Brad as well
for the namespace thing.

agreed with file(...) extension as well.

that said isn't the TIMESTAMP misleading?
shouldn't it be called DATE instead?



-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


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

2012-09-27 Thread Rolf Eike Beer
Eric Noulard wrote:
 2012/9/27 David Cole david.c...@kitware.com:
  H. Good idea.
  
  Should we add a new command for this? Or should it be a sub-command of
  string( like RANDOM is?
  
  And... while we're at it, I've always thought we should add the
  ability to get the creation/modified/access times from a file via the
  CMake file command. If we allow getting the current time, we should
  leverage some of the same transformation-to-string code in the file
  command to get the various times associated with a file.
  
  What do other devs here think:
  New command or string sub-command for this functionality?
 
 string sub-command for me, and agreed with Brad as well
 for the namespace thing.
 
 agreed with file(...) extension as well.
 
 that said isn't the TIMESTAMP misleading?
 shouldn't it be called DATE instead?

I would second that.

Eike

signature.asc
Description: This is a digitally signed message part.
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

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

2012-09-27 Thread Rolf Eike Beer
Am Donnerstag, 27. September 2012, 17:10:20 schrieb Nils Gladitz:
 I've tried to reimplement this as a sting sub-command (patch attached).

Looks good, but the indentation looks wrong at some places.

signature.asc
Description: This is a digitally signed message part.
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers