mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-07 11:10:16 +01:00
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 <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015 Reviewed-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
8f84d2d250
commit
191da55a72
2 changed files with 2 additions and 14 deletions
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue