Skip to content

Commit

Permalink
[build][Windows] Fix date parsing regex for varying locales.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaperno committed Feb 12, 2017
1 parent 5e63bbc commit d5476af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/Macros.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
macro(today RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "[^0-9]*([0-9]+)/([0-9]+)/([0-9]+).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
string(REGEX REPLACE "[^0-9]*([0-9]+)[^0-9]([0-9]+)[^0-9]([0-9]+).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
Expand Down

0 comments on commit d5476af

Please sign in to comment.