Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / kwsys / kwsysDateStamp.py
blobe719a42169b051d0c5e30b86500bd04974c8d250
1 #!/usr/bin/python
3 import sys,os
4 import time
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)
9 else:
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.
17 ct = time.localtime()
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))
32 fout.close()