summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/string/Timestamp.cmake
diff options
context:
space:
mode:
authorBernhard M. Wiedemann <bwiedemann@suse.de>2017-01-25 06:15:40 (GMT)
committerBrad King <brad.king@kitware.com>2017-01-26 15:21:41 (GMT)
commit243aed525a2fd8e5fe32139fd0f8d0cc0e40cc33 (patch)
tree43bb5febd43b6892d0736aad02bdbc1fa586a61d /Tests/RunCMake/string/Timestamp.cmake
parenta007f15344007a6261209a409c6988b0e4c4b7e0 (diff)
downloadCMake-243aed525a2fd8e5fe32139fd0f8d0cc0e40cc33.zip
CMake-243aed525a2fd8e5fe32139fd0f8d0cc0e40cc33.tar.gz
CMake-243aed525a2fd8e5fe32139fd0f8d0cc0e40cc33.tar.bz2
cmTimestamp: Support SOURCE_DATE_EPOCH to override current time
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.
Diffstat (limited to 'Tests/RunCMake/string/Timestamp.cmake')
-rw-r--r--Tests/RunCMake/string/Timestamp.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/Timestamp.cmake b/Tests/RunCMake/string/Timestamp.cmake
new file mode 100644
index 0000000..1232300
--- /dev/null
+++ b/Tests/RunCMake/string/Timestamp.cmake
@@ -0,0 +1,3 @@
+set(ENV{SOURCE_DATE_EPOCH} "1123456789")
+string(TIMESTAMP RESULT "%Y-%m-%d %H:%M:%S %a %b %y day=%j wd=%w week=%U %%I=%I" UTC)
+message("RESULT=${RESULT}")