6 # Get the path to the directory containing this script.
7 if __name__
== '__main__':
8 selfdir
= os
.path
.abspath(sys
.path
[0] or os
.curdir
)
10 selfdir
= os
.path
.abspath(os
.path
.dirname(__file__
))
12 # Open the CMake code file.
13 fname
= os
.path
.join(selfdir
, 'kwsysDateStamp.cmake')
14 fout
= open(fname
, 'w');
16 # Get the current time.
19 # Write the CMake code describing the date.
20 fout
.write("""# Do not edit! Generated by kwsysDateStamp.py
22 # KWSys version date year component. Format is CCYY.
23 SET(KWSYS_DATE_STAMP_YEAR %04u)
25 # KWSys version date month component. Format is MM.
26 SET(KWSYS_DATE_STAMP_MONTH %02u)
28 # KWSys version date day component. Format is DD.
29 SET(KWSYS_DATE_STAMP_DAY %02u)
30 """ % (ct
.tm_year
, ct
.tm_mon
, ct
.tm_mday
))