diff options
author | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2018-11-18 08:14:50 +0100 |
---|---|---|
committer | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2018-11-18 14:04:40 +0100 |
commit | e27c8969982e970d714cfa469f179bed5000494b (patch) | |
tree | bfe01aa15b6a0e39536fab8211f7e4dec4bcd317 /CMakeLists.txt | |
parent | ccc347d1f49f71d42a5d0834ae9dabe597d20c74 (diff) | |
download | tigervnc-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 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fb33600..8a89d454 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # Setup # -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.11) if(POLICY CMP0022) cmake_policy(SET CMP0022 OLD) endif() @@ -43,9 +43,7 @@ if(MSVC) endif() if(NOT BUILD_TIMESTAMP) - set(BUILD_TIMESTAMP "") - execute_process(COMMAND "date" "+%Y-%m-%d %H:%M" OUTPUT_VARIABLE BUILD_TIMESTAMP) - string(REGEX REPLACE "\n" "" BUILD_TIMESTAMP ${BUILD_TIMESTAMP}) + STRING(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d %H:%M" UTC) endif() # Default to optimised builds instead of debug ones. Our code has no bugs ;) |