2007-11-13 01:34:14 +03:00
|
|
|
#!/usr/bin/python
|
2009-09-28 19:37:35 +04:00
|
|
|
#=============================================================================
|
|
|
|
# KWSys - Kitware System Library
|
|
|
|
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#=============================================================================
|
2007-11-13 01:34:14 +03:00
|
|
|
|
|
|
|
import sys,os
|
|
|
|
import time
|
|
|
|
|
|
|
|
# Get the path to the directory containing this script.
|
|
|
|
if __name__ == '__main__':
|
|
|
|
selfdir = os.path.abspath(sys.path[0] or os.curdir)
|
|
|
|
else:
|
|
|
|
selfdir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
# Open the CMake code file.
|
|
|
|
fname = os.path.join(selfdir, 'kwsysDateStamp.cmake')
|
|
|
|
fout = open(fname, 'w');
|
|
|
|
|
|
|
|
# Get the current time.
|
|
|
|
ct = time.localtime()
|
|
|
|
|
|
|
|
# Write the CMake code describing the date.
|
|
|
|
fout.write("""# Do not edit! Generated by kwsysDateStamp.py
|
2009-09-28 19:37:35 +04:00
|
|
|
#=============================================================================
|
|
|
|
# KWSys - Kitware System Library
|
|
|
|
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#=============================================================================
|
2007-11-13 01:34:14 +03:00
|
|
|
|
|
|
|
# KWSys version date year component. Format is CCYY.
|
2007-11-13 02:22:22 +03:00
|
|
|
SET(KWSYS_DATE_STAMP_YEAR %04u)
|
2007-11-13 01:34:14 +03:00
|
|
|
|
|
|
|
# KWSys version date month component. Format is MM.
|
2007-11-13 02:22:22 +03:00
|
|
|
SET(KWSYS_DATE_STAMP_MONTH %02u)
|
2007-11-13 01:34:14 +03:00
|
|
|
|
|
|
|
# KWSys version date day component. Format is DD.
|
2007-11-13 02:22:22 +03:00
|
|
|
SET(KWSYS_DATE_STAMP_DAY %02u)
|
2007-11-13 01:34:14 +03:00
|
|
|
""" % (ct.tm_year, ct.tm_mon, ct.tm_mday))
|
|
|
|
|
|
|
|
fout.close()
|