diff options
author | Nils Gladitz <gladitz@scivis.de> | 2012-10-05 19:55:07 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2012-12-05 15:39:10 (GMT) |
commit | 711e2b3b5c674d4f754b5b214d511be6ce7e8f4d (patch) | |
tree | eac34a0d730f835f60e4fb28cc0e039c30298d3d /Source/cmStringCommand.h | |
parent | 2bb2745fa8c260d12aca33d2e1fd26a92d3bfa6b (diff) | |
download | CMake-711e2b3b5c674d4f754b5b214d511be6ce7e8f4d.zip CMake-711e2b3b5c674d4f754b5b214d511be6ce7e8f4d.tar.gz CMake-711e2b3b5c674d4f754b5b214d511be6ce7e8f4d.tar.bz2 |
CMake: Add TIMESTAMP subcommand to string and file commands
Diffstat (limited to 'Source/cmStringCommand.h')
-rw-r--r-- | Source/cmStringCommand.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 728b1bc..7e0694e 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -93,6 +93,7 @@ public: " string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]\n" " [RANDOM_SEED <seed>] <output variable>)\n" " string(FIND <string> <substring> <output variable> [REVERSE])\n" + " string(TIMESTAMP <output variable> [<format string>] [UTC])\n" "REGEX MATCH will match the regular expression once and store the " "match in the output variable.\n" "REGEX MATCHALL will match the regular expression as many times as " @@ -142,7 +143,33 @@ public: " () Saves a matched subexpression, which can be referenced \n" " in the REGEX REPLACE operation. Additionally it is saved\n" " by all regular expression-related commands, including \n" - " e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9)."; + " e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).\n" + "TIMESTAMP will write a string representation of " + "the current date and/or time to <output variable>.\n" + "Should the command be unable to obtain a timestamp " + "<output variable> will be set to the empty string \"\".\n" + "The optional UTC flag requests the current date/time " + "representation to be in Coordinated Universal Time (UTC) " + "rather than local time.\n" + "The optional <format string> may contain the following " + "format specifiers: \n" + " %d The day of the current month (01-31).\n" + " %H The hour on a 24-hour clock (00-23).\n" + " %I The hour on a 12-hour clock (01-12).\n" + " %j The day of the current year (001-366).\n" + " %m The month of the current year (01-12).\n" + " %M The minute of the current hour (00-59).\n" + " %S The second of the current minute.\n" + " 60 represents a leap second. (00-60)\n" + " %U The week number of the current year (00-53).\n" + " %w The day of the current week. 0 is Sunday. (0-6)\n" + " %y The last two digits of the current year (00-99)\n" + " %Y The current year. \n" + "Unknown format specifiers will be ignored " + "and copied to the output as-is.\n" + "If no explicit <format string> is given it will default to:\n" + " %Y-%m-%dT%H:%M:%S for local time.\n" + " %Y-%m-%dT%H:%M:%SZ for UTC."; } cmTypeMacro(cmStringCommand, cmCommand); @@ -165,6 +192,7 @@ protected: bool HandleStripCommand(std::vector<std::string> const& args); bool HandleRandomCommand(std::vector<std::string> const& args); bool HandleFindCommand(std::vector<std::string> const& args); + bool HandleTimestampCommand(std::vector<std::string> const& args); class RegexReplacement { |