-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelper.py
49 lines (40 loc) · 1.29 KB
/
Helper.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
40
41
42
43
44
45
46
47
48
49
# This script provides helper functions
import os
import sys
def UpdateSubmodules():
os.system("git submodule update --recursive --remote")
def InitSubmodules():
os.system("git submodule update --init --recursive")
def GenerateProject():
os.system("cmake -S ./ -B ./build")
def BuildProject():
os.system("cmake --build ./build")
def PrintHelp():
print("VoxoGen3D Helper Script\n")
print("Usage:")
print("\tpython Helper.py help - Prints this help message")
print("\tpython Helper.py initsm - Initiates the submodules")
print("\tpython Helper.py updatesm - Updates the submodules")
print("\tpython Helper.py generate - Generate CMake project files")
print("\tpython Helper.py build - Build the project")
def Main():
argc = len(sys.argv)
if argc == 2:
argv = sys.argv[1].lower()
if argv == "help":
PrintHelp()
elif argv == "initsm":
InitSubmodules()
elif argv == "updatesm":
UpdateSubmodules()
elif argv == "generate":
GenerateProject()
elif argv == "build":
BuildProject()
else:
print("Unknown command : " + argv + "\n")
PrintHelp()
else:
PrintHelp()
if __name__ == "__main__":
Main()