source: trunk/tmdmcreator/build/update-tmdmcreator.py @ 37

Revision 29, 2.2 KB checked in by lucsch, 12 years ago (diff)

Updating build script for Windows

RevLine 
[4]1#!/usr/bin/env python
2# encoding: utf-8
3"""
4update-tmdmcreator.py
5
6Created by Lucien Schreiber on 2013-02-15.
7Copyright (c) 2013 . All rights reserved.
8"""
9
10import sys
11import os
12from subprocess import *
13
14# compatibililty Python 2.7 and 3.0
15try:
16  from Tkinter import *
17except:
18  from tkinter import *
19
20def GetCmakeDirName():
21  pathname = os.path.dirname(sys.argv[0])       
22  return os.path.abspath(pathname)
23
24
25def updateSVN():
26  myPath = os.path.normpath(os.path.join(GetCmakeDirName(), ".."))
27  print ("Updating subversion in: {}".format(myPath))
28  try:
29    p = Popen("svn update", shell=True, cwd = myPath)
30    p.wait()
31  except:
32    print ("Error updating subversion in: {}".format(myPath))
33
34  # print version number
35  try:
36    p = Popen("svnversion", shell=True, cwd=myPath, stdout=PIPE, stderr=PIPE)
37    information = p.communicate()
38    myVersion = str(information[0])
39    myVersionAlone = myVersion[myVersion.find("'")+1:-3] 
40    print ("Updated version is: {}".format(myVersionAlone))
41  except:
42    print("Error getting version for {}".format(GetCmakeDirName()))
43
44
45def buildMacBook():
[6]46  builddir = "/Users/lucien/DATA/PRJ/DATAMODEL/bin"
[4]47  try:
48    p = Popen("cmake -GXcode " + GetCmakeDirName() + "  -DCMAKE_OSX_ARCHITECTURES:TEXT=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET:TEXT=10.6 -DCMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE:FILE=/Users/lucien/DATA/PROGRAMATION/_LIB/64/_LIBWXSVN/bin/wx-config", shell=True, cwd=builddir)
49    p.wait()
50  except:
51    print("Error creating makefile")
52
53
[29]54def buildWindow7():
55  builddir = "D:\\PRJ\\DATAMODEL\\bin"
56  try:
57    p = Popen("cmake -G\"Visual Studio 10\" " + GetCmakeDirName() + " -DUSE_MT_LIBRARY:BOOL=1", shell=True, cwd=builddir)
58    p.wait()
59  except:
60    print("Error creating makefile")
[4]61
62if __name__ == '__main__':
63  root = Tk()
64  myContainer1 = Frame(root)
65  myContainer1.pack()
66
67  label = Label(myContainer1, text="TmDmCreator")
68  label.pack()
69
70  button3 = Button(myContainer1, text=("Update subversion"), command=updateSVN)
71  button3.pack()
72
73  button2 = Button(myContainer1, text="Configure MacBook", command=buildMacBook)
74  button2.pack()
[29]75 
76  button4 = Button(myContainer1, text="Configure Window 7", command=buildWindow7)
77  button4.pack()
[4]78
79  root.mainloop()
Note: See TracBrowser for help on using the repository browser.