1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 11:29:51 +03:00

[build][Windows] Fix date parsing regex for varying locales.

This commit is contained in:
Max Paperno 2017-02-12 06:51:28 -05:00
parent 5e63bbcd83
commit d5476af719

View file

@ -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}})