Commit 191da55a authored by Ralf Habacker's avatar Ralf Habacker

Use cmake build in timestamp function to generate the build time stamp

The recent implementation generates a timestamp containing eol on
linux hosts, which generates unparseable versioninfo.rc.

This commit raises the minimal required cmake version to 3.0.2.
Signed-off-by: Ralf Habacker's avatarRalf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015Reviewed-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 8f84d2d2
......@@ -7,7 +7,7 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(dbus)
# we need to be up to date
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2 FATAL_ERROR)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
......@@ -43,7 +43,7 @@ autopackage(
)
include(Macros)
TIMESTAMP(DBUS_BUILD_TIMESTAMP)
string(TIMESTAMP DBUS_BUILD_TIMESTAMP "%Y%m%d%H%M" UTC)
########### basic vars ###############
......
......@@ -30,18 +30,6 @@ if(DBUS_BUILD_TESTS AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Win
endif()
endif()
MACRO(TIMESTAMP RESULT)
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}")
else ()
EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d%H%M" OUTPUT_VARIABLE ${RESULT})
endif ()
ENDMACRO()
macro(add_test_executable _target _source)
add_executable(${_target} ${_source})
target_link_libraries(${_target} ${ARGN})
......
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