mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-30 17:40:14 +01:00
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=59733 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
48fb808351
commit
29a27c47e6
1 changed files with 3 additions and 6 deletions
|
|
@ -1,15 +1,12 @@
|
|||
|
||||
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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue