From 283c1971b2ae484fbfe2c279446f3612004f7c7a Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Tue, 22 Dec 2020 15:29:56 +0100 Subject: Use cmake TIMESTAMP function to allow to override build date with SOURCE_DATE_EPOCH in order to make builds reproducible. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. Also use UTC to be independent of timezone. --- tools/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 7609cd3..1b09975 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -45,9 +45,10 @@ if (BUILD_TOOLS_DOCS) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc) set(XMLTO_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doc/man-date.ent) + STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC) add_custom_command( OUTPUT ${XMLTO_DEPENDS} - COMMAND date +'%Y-%m-%d' > ${XMLTO_DEPENDS} + COMMAND echo ${BUILD_DATE} > ${XMLTO_DEPENDS} VERBATIM ) -- cgit v1.2.1