-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.py
39 lines (28 loc) · 1.04 KB
/
bootstrap.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
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python3
# https://github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook/blob/master/bootstrap.py
import os
import sys
import platform
import subprocess
Python = sys.executable if not " " in sys.executable else '"{}"'.format(sys.executable)
def executeCommandSilent(command):
out = open(os.devnull, 'w')
err = subprocess.STDOUT
return subprocess.call(command, shell = True, stdout=out, stderr=err);
def runPythonScript(Script, Params):
if os.system( Python + " " + Script + " " + Params ) != 0:
print( "Unable to run " + Script )
exit(255)
if executeCommandSilent(Python + " --version") != 0:
print( "Make sure Python can be started from the command line (add path to `python.exe` to PATH on Windows)" )
exit(255)
if executeCommandSilent("cmake --version") != 0:
print( "Install CMake first" )
exit(255)
if executeCommandSilent("git --version") != 0:
print( "Install Git first" )
exit(255)
# run Tools/Bootstrap
runPythonScript( os.path.join("bootstrapping", "bootstrap.py"), "-b deps" )
print( "" )
print( "Bootstrapping done." )