myx-cmake/MyxCMake/modules/MyxCMakeToday.cmake

9 lines
268 B
CMake
Raw Normal View History

2021-12-08 11:32:04 +00:00
if(NOT TODAY)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE TODAY)
else()
execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE TODAY)
endif()
string(REGEX REPLACE "(..)/(..)/(....).*" "\\3-\\2-\\1" TODAY ${TODAY})
endif()