cmlib/CMLibToday.cmake

13 lines
328 B
CMake

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()