Skip to content

Commit f3d8249

Browse files
committed
Minor refactor in installdepswin.py.
1 parent 0cd1aea commit f3d8249

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

installdepswin.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,26 @@ def UnzipFile (zipFile, targetFolder):
1919
def BuildSolution (msBuildPath, solutionPath, configuration):
2020
print ('Building ' + solutionPath)
2121
subprocess.call ([msBuildPath, solutionPath, '/property:Configuration=' + configuration, '/property:Platform=x64'])
22-
pass
22+
23+
def InstallwxWidgets (targetFolder, msBuildPath):
24+
wxWidgetsName = 'wxWidgets-3.1.2'
25+
wxWidgetsZipUrl = 'https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.7z'
26+
wxWidgetsZipPath = os.path.join (targetFolder, wxWidgetsName + '.7z')
27+
wxWidgetsFolderPath = os.path.join (targetFolder, wxWidgetsName)
28+
wxWidgetsIncludeFolderPath = os.path.join (wxWidgetsFolderPath, 'include')
29+
wxWidgetsLibFolderPath = os.path.join (wxWidgetsFolderPath, 'lib', 'vc_x64_lib')
30+
if not os.path.exists (wxWidgetsIncludeFolderPath) or not os.path.exists (wxWidgetsLibFolderPath):
31+
DownloadFile (wxWidgetsZipUrl, wxWidgetsZipPath)
32+
UnzipFile (wxWidgetsZipPath, wxWidgetsFolderPath)
33+
solutionPath = os.path.join (wxWidgetsFolderPath, 'build', 'msw', 'wx_vc15.sln')
34+
BuildSolution (msBuildPath, solutionPath, 'Debug')
35+
BuildSolution (msBuildPath, solutionPath, 'Release')
2336

2437
def Main (argv):
2538
if len (argv) != 3:
2639
print 'usage: installdepswin.py <targetFolder> <msBuildPath>'
2740
return 1
41+
2842
currentDir = os.path.dirname (os.path.abspath (__file__))
2943
os.chdir (currentDir)
3044

@@ -34,18 +48,7 @@ def Main (argv):
3448
if not os.path.exists (targetFolder):
3549
os.makedirs (targetFolder)
3650

37-
wxWidgetsName = 'wxWidgets-3.1.2'
38-
wxWidgetsZipUrl = 'https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.7z'
39-
wxWidgetsZipPath = os.path.join (targetFolder, wxWidgetsName + '.7z')
40-
wxWidgetsFolderPath = os.path.join (targetFolder, wxWidgetsName)
41-
wxWidgetsIncludeFolderPath = os.path.join (wxWidgetsFolderPath, 'include')
42-
wxWidgetsLibFolderPath = os.path.join (wxWidgetsFolderPath, 'lib', 'vc_x64_lib')
43-
if not os.path.exists (wxWidgetsIncludeFolderPath) or not os.path.exists (wxWidgetsLibFolderPath):
44-
DownloadFile (wxWidgetsZipUrl, wxWidgetsZipPath)
45-
UnzipFile (wxWidgetsZipPath, wxWidgetsFolderPath)
46-
solutionPath = os.path.join (wxWidgetsFolderPath, 'build', 'msw', 'wx_vc15.sln')
47-
BuildSolution (msBuildPath, solutionPath, 'Debug')
48-
BuildSolution (msBuildPath, solutionPath, 'Release')
51+
InstallwxWidgets (targetFolder, msBuildPath)
4952
return 0
5053

5154
sys.exit (Main (sys.argv))

0 commit comments

Comments
 (0)