From 82860bd55c832b9cd987aa28b65e08ef7fdfe91d Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Tue, 12 Sep 2017 17:12:07 -0700 Subject: [PATCH] Use cmake TIMESTAMP function Summary: because it is not only platform independent but also allows to override the build date This helps to make ceph builds reproducible (that includes a fork of rockdb in a submodule) Also adds UTC flag, to be independent of timezone. Requires cmake-2.8.11+ from 2013 Closes https://github.com/facebook/rocksdb/pull/2848 Differential Revision: D5820189 Pulled By: yiwu-arbug fbshipit-source-id: e3e8c1550e10e238c173f6c5d9ba15f71ad3ce28 --- CMakeLists.txt | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0ccc1e4f..54e6de280 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ # 3. cmake .. # 4. make -j -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.11) project(rocksdb) if(POLICY CMP0042) @@ -98,17 +98,7 @@ else() endif() endif() -if(WIN32) - execute_process(COMMAND powershell -noprofile -Command "Get-Date -format MM_dd_yyyy" OUTPUT_VARIABLE DATE) - execute_process(COMMAND powershell -noprofile -Command "Get-Date -format HH:mm:ss" OUTPUT_VARIABLE TIME) - string(REGEX REPLACE "(..)_(..)_..(..).*" "\\1/\\2/\\3" DATE "${DATE}") - string(REGEX REPLACE "(..):(.....).*" " \\1:\\2" TIME "${TIME}") - set(GIT_DATE_TIME "${DATE} ${TIME}") -else() - execute_process(COMMAND date "+%Y/%m/%d %H:%M:%S" OUTPUT_VARIABLE DATETIME) - string(REGEX REPLACE "\n" "" DATETIME ${DATETIME}) - set(GIT_DATE_TIME "${DATETIME}") -endif() +string(TIMESTAMP GIT_DATE_TIME "%Y/%m/%d %H:%M:%S" UTC) find_package(Git)