summaryrefslogtreecommitdiffstats
path: root/java/CMakeLists.txt
diff options
context:
space:
mode:
authorBernhard M. Wiedemann <bwiedemann@suse.de>2018-11-18 08:14:50 +0100
committerBernhard M. Wiedemann <bwiedemann@suse.de>2018-11-18 14:04:40 +0100
commite27c8969982e970d714cfa469f179bed5000494b (patch)
treebfe01aa15b6a0e39536fab8211f7e4dec4bcd317 /java/CMakeLists.txt
parentccc347d1f49f71d42a5d0834ae9dabe597d20c74 (diff)
downloadtigervnc-e27c8969982e970d714cfa469f179bed5000494b.tar.gz
tigervnc-e27c8969982e970d714cfa469f179bed5000494b.zip
Use cmake TIMESTAMP function
because it is not only platform independent but also allows to override the build date This helps to make tigervnc builds reproducible See https://reproducible-builds.org/ for why this is good Also adds UTC flag, to be independent of timezone. Also changes JAVA_DATE format to ISO-8601 date format. Requires cmake-2.8.11+ from 2013
Diffstat (limited to 'java/CMakeLists.txt')
-rw-r--r--java/CMakeLists.txt11
1 files changed, 4 insertions, 7 deletions
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index 23137f77..da24dcfa 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.11)
project(tigervnc-java Java)
if(NOT VERSION)
@@ -25,13 +25,10 @@ set(JAVA_KEYPASS NOTFOUND CACHE STRING "Password used to protect the private key
set(JAVA_TSA_URL NOTFOUND CACHE STRING "URL of Time Stamping Authority (TSA)")
if(NOT BUILD)
- execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
+ STRING(TIMESTAMP BUILD "%Y%m%d" UTC)
endif()
-execute_process(COMMAND "date" "+%b %d %Y" OUTPUT_VARIABLE JAVA_DATE)
-execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE JAVA_TIME)
-string(REGEX REPLACE "\n" "" JAVA_DATE ${JAVA_DATE})
-string(REGEX REPLACE "\n" "" JAVA_TIME ${JAVA_TIME})
-string(REGEX REPLACE "\n" "" BUILD ${BUILD})
+STRING(TIMESTAMP JAVA_DATE "%Y-%m-%d" UTC)
+STRING(TIMESTAMP JAVA_TIME "%H:%M:%S" UTC)
set(JAVA_SOURCES "")
set(JAVA_CLASSES "")