From 2588137af907699dcc365dff0534507058e1789c Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 17 Oct 2017 20:57:50 +0200 Subject: [PATCH] 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 raise the minimal required cmake version to 3.0.2. Signed-off-by: Ralf Habacker Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015 --- cmake/CMakeLists.txt | 4 ++-- cmake/modules/Macros.cmake | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a9f53780..3ac71a5a 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -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 ############### diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake index 7ce07207..186c0b09 100644 --- a/cmake/modules/Macros.cmake +++ b/cmake/modules/Macros.cmake @@ -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}) -- 2.12.3