aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2018-11-27 11:22:34 -0500
committerGitHub <noreply@github.com>2018-11-27 11:22:34 -0500
commit36177f99a93ccb21ac0abfa0d3e2dc3315074917 (patch)
treef7e4fb5b08ed33d01a2f1906cb0efe7b5138dbc4
parent7af4449036b877727b63a79ec95b9927bdef1566 (diff)
parente27c8969982e970d714cfa469f179bed5000494b (diff)
downloadtigervnc-36177f99a93ccb21ac0abfa0d3e2dc3315074917.tar.gz
tigervnc-36177f99a93ccb21ac0abfa0d3e2dc3315074917.zip
Merge pull request #765 from bmwiedemann/timestamp
Use cmake TIMESTAMP function
-rw-r--r--CMakeLists.txt6
-rw-r--r--java/CMakeLists.txt11
2 files changed, 6 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f87fc252..7a9a7ce1 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 ;)
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 "")