-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.py
49 lines (43 loc) · 1.4 KB
/
init.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
import platform
import subprocess
def RunSubmoduleGet():
print("Running Submodule Get")
subprocess.run(('git', 'submodule', 'update', '--init', '--recursive'))
def RunConan(build_type):
print("Running Conan")
subprocess.run((
'conan', 'install', '.',
'--build', 'missing',
'--output-folder=./build',
f'--settings=build_type={build_type}'
))
def RunCMake():
print("Running CMake")
match platform.system():
case "Windows":
subprocess.run((
"cmake", "..", "-G", "Visual Studio 17 2022", "-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake"
), cwd="./build")
case "Linux":
subprocess.run((
'cmake', '..',
'-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake',
'-DCMAKE_BUILD_TYPE=Debug'
), cwd='./build')
case "Darwin":
subprocess.run((
'cmake', '..',
'-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake',
'-DCMAKE_BUILD_TYPE=Debug'
), cwd='./build')
case _:
subprocess.run((
'cmake', '..',
'-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake',
'-DCMAKE_BUILD_TYPE=Debug'
), cwd='./build')
if __name__ == "__main__":
RunSubmoduleGet()
RunConan("Debug")
#RunConan("Release")
RunCMake()