-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-win32.py
26 lines (22 loc) · 1.05 KB
/
setup-win32.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#---------------------------------------------------------------------------------------------------
# File created by Jeff Preshing and released without restrictions
# CMakeDemo: https://github.com/preshing/CMakeDemo
#---------------------------------------------------------------------------------------------------
import os
import urllib.request
import zipfile
def downloadZip(url, extractedFolderName = None):
zipFileName = url.rsplit('/', 1)[-1]
assert zipFileName.endswith('.zip')
if not extractedFolderName:
extractedFolderName = zipFileName[:-4]
if not os.path.exists(extractedFolderName):
print('Downloading %s' % zipFileName)
urllib.request.urlretrieve(url, zipFileName)
zipfile.ZipFile(zipFileName).extractall()
os.remove(zipFileName)
assert os.path.exists(extractedFolderName)
externFolder = os.path.normpath(os.path.join(__file__, '../extern'))
os.makedirs(externFolder, exist_ok=True)
os.chdir(externFolder)
downloadZip('https://www.libsdl.org/release/SDL2-devel-2.0.12-VC.zip', 'SDL2-2.0.12')