[Cmake-commits] CMake branch, next, updated. v3.6.2-1965-gca930ba

Brad King brad.king at kitware.com
Mon Sep 12 15:23:11 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ca930ba20f364bd9613a2df1da0074b1260ddf0b (commit)
       via  410add400803340581eccf5ac1c83c8d4e40ad5a (commit)
       via  751f7b5255d861abc3105d3d971164293b3dec60 (commit)
      from  e5a23b9d152d9114bfdb65caeb7c33c35ab21b59 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca930ba20f364bd9613a2df1da0074b1260ddf0b
commit ca930ba20f364bd9613a2df1da0074b1260ddf0b
Merge: e5a23b9 410add4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 12 15:23:10 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 12 15:23:10 2016 -0400

    Merge topic 'timestamp-names' into next
    
    410add40 Help: Add notes for topic 'timestamp-names'
    751f7b52 string(TIMESTAMP ...): add '%a' and '%b' format specifiers


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=410add400803340581eccf5ac1c83c8d4e40ad5a
commit 410add400803340581eccf5ac1c83c8d4e40ad5a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 12 15:15:50 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Sep 12 15:15:50 2016 -0400

    Help: Add notes for topic 'timestamp-names'

diff --git a/Help/release/dev/timestamp-names.rst b/Help/release/dev/timestamp-names.rst
new file mode 100644
index 0000000..ea54b5c
--- /dev/null
+++ b/Help/release/dev/timestamp-names.rst
@@ -0,0 +1,6 @@
+timestamp-names
+---------------
+
+* The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)`
+  commands gained support for the ``%a`` and ``%b`` placeholders.
+  These are the abbreviated weekday and month names.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=751f7b5255d861abc3105d3d971164293b3dec60
commit 751f7b5255d861abc3105d3d971164293b3dec60
Author:     Ruslan Baratov <ruslan_baratov at yahoo.com>
AuthorDate: Sat Sep 10 00:39:26 2016 +0300
Commit:     Ruslan Baratov <ruslan_baratov at yahoo.com>
CommitDate: Mon Sep 12 19:07:38 2016 +0300

    string(TIMESTAMP ...): add '%a' and '%b' format specifiers
    
    %b: Abbreviated month name (e.g. Oct).
    %a: Abbreviated weekday name (e.g. Fri).

diff --git a/Help/command/string.rst b/Help/command/string.rst
index 19a095a..8028333 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -278,12 +278,14 @@ specifiers:
    %I        The hour on a 12-hour clock (01-12).
    %j        The day of the current year (001-366).
    %m        The month of the current year (01-12).
+   %b        Abbreviated month name (e.g. Oct).
    %M        The minute of the current hour (00-59).
    %s        Seconds since midnight (UTC) 1-Jan-1970 (UNIX time).
    %S        The second of the current minute.
              60 represents a leap second. (00-60)
    %U        The week number of the current year (00-53).
    %w        The day of the current week. 0 is Sunday. (0-6)
+   %a        Abbreviated weekday name (e.g. Fri).
    %y        The last two digits of the current year (00-99)
    %Y        The current year.
 
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 61b74db..a94212c 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -123,6 +123,8 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
   formatString += flag;
 
   switch (flag) {
+    case 'a':
+    case 'b':
     case 'd':
     case 'H':
     case 'I':
diff --git a/Tests/CMakeTests/String-TIMESTAMP-MonthWeekNames.cmake b/Tests/CMakeTests/String-TIMESTAMP-MonthWeekNames.cmake
new file mode 100644
index 0000000..1cd44ff
--- /dev/null
+++ b/Tests/CMakeTests/String-TIMESTAMP-MonthWeekNames.cmake
@@ -0,0 +1,11 @@
+string(TIMESTAMP output "%a;%b")
+message("~${output}~")
+
+list(LENGTH output output_length)
+
+set(expected_output_length 2)
+
+if(NOT output_length EQUAL ${expected_output_length})
+    message(FATAL_ERROR "expected ${expected_output_length} entries in output "
+        "with all specifiers; found ${output_length}")
+endif()
diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in
index aba35fe..a45b205 100644
--- a/Tests/CMakeTests/StringTest.cmake.in
+++ b/Tests/CMakeTests/StringTest.cmake.in
@@ -36,6 +36,8 @@ set(TIMESTAMP-IncompleteSpecifier-RESULT 0)
 set(TIMESTAMP-IncompleteSpecifier-STDERR "~foobar%~")
 set(TIMESTAMP-AllSpecifiers-RESULT 0)
 set(TIMESTAMP-AllSpecifiers-STDERR "~[0-9]+(;[0-9]+)*~")
+set(TIMESTAMP-MonthWeekNames-RESULT 0)
+set(TIMESTAMP-MonthWeekNames-STDERR "~[^%]+;[^%]+~")
 set(TIMESTAMP-UnixTime-RESULT 0)
 set(TIMESTAMP-UnixTime-STDERR "~[1-9][0-9]+~")
 
@@ -60,6 +62,7 @@ check_cmake_test(String
   TIMESTAMP-UnknownSpecifier
   TIMESTAMP-IncompleteSpecifier
   TIMESTAMP-AllSpecifiers
+  TIMESTAMP-MonthWeekNames
   TIMESTAMP-UnixTime
   )
 

-----------------------------------------------------------------------

Summary of changes:
 Help/command/string.rst                                          |    2 ++
 Help/release/dev/timestamp-names.rst                             |    6 ++++++
 Source/cmTimestamp.cxx                                           |    2 ++
 ...AllSpecifiers.cmake => String-TIMESTAMP-MonthWeekNames.cmake} |    4 ++--
 Tests/CMakeTests/StringTest.cmake.in                             |    3 +++
 5 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 Help/release/dev/timestamp-names.rst
 copy Tests/CMakeTests/{String-TIMESTAMP-AllSpecifiers.cmake => String-TIMESTAMP-MonthWeekNames.cmake} (73%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list