Commit 29a27c47 authored by Ralf Habacker's avatar Ralf Habacker Committed by Simon McVittie

Fixed cmake cross compile timestamp creating.

We only need to distinct "Windows" from unix like systems

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59733Reviewed-by: 's avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
parent 48fb8083
MACRO(TIMESTAMP RESULT)
IF(WIN32)
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE DATE)
string(REGEX REPLACE "(..)[/.](..)[/.](....).*" "\\3\\2\\1" DATE ${DATE})
EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE TIME)
string(REGEX REPLACE "(..):(..)" "\\1\\2" TIME ${TIME})
set (${RESULT} "${DATE}${TIME}")
ELSEIF(UNIX)
else ()
EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d%H%M" OUTPUT_VARIABLE ${RESULT})
ELSE()
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} 000000000000)
ENDIF()
endif ()
ENDMACRO()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment