FreeRDP/cmake/today.cmake

15 lines
372 B
CMake
Raw Normal View History

# This script returns the current date in ISO format
#
# YYYY-MM-DD
#
MACRO (TODAY RESULT)
2024-10-09 18:06:29 +03:00
if (DEFINED ENV{SOURCE_DATE_EPOCH} AND NOT WIN32)
EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d"
OUTPUT_VARIABLE ${RESULT}
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
STRING(TIMESTAMP ${RESULT} "%Y-%m-%d" UTC)
endif()
ENDMACRO (TODAY)