summaryrefslogtreecommitdiff
path: root/Source/cm_get_date.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-14 13:22:29 -0500
committerBrad King <brad.king@kitware.com>2015-01-19 14:16:19 -0500
commit3a60c899fce77f221cba670b62c90fe2d2daffed (patch)
tree7d7db3b6820f0766b5ecbdcb411b5d5b07ba6ed7 /Source/cm_get_date.h
parent90f9c42732a18e53943c3aa27de76c2511c5a0c6 (diff)
downloadcmake-3a60c899fce77f221cba670b62c90fe2d2daffed.tar.gz
cmake: Teach "-E tar" command a "--mtime=" option
Add an option to set the mtime of entries in a tarball so that one can create a tarball with a consistent content hash (e.g. MD5) for a given set of files regardless of their current timestamps on disk. This will be useful for submission of tarballs to CDash, which tracks content hashes to avoid duplication. Inspired-by: Bill Hoffman <bill.hoffman@kitware.com>
Diffstat (limited to 'Source/cm_get_date.h')
-rw-r--r--Source/cm_get_date.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cm_get_date.h b/Source/cm_get_date.h
new file mode 100644
index 0000000000..d5f6d3e0af
--- /dev/null
+++ b/Source/cm_get_date.h
@@ -0,0 +1,28 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc.
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cm_get_date_h
+#define cm_get_date_h
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Parse a date/time string. Treat relative times with respect to 'now'. */
+time_t cm_get_date(time_t now, const char *str);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif