forked from maharjun/WorkingMemory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SetupTimeDelNetSim.py
executable file
·42 lines (31 loc) · 1.32 KB
/
SetupTimeDelNetSim.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
#!/usr/bin/env python3.5
import sys
import os
from RepoManagement.BasicUtils import changedDir, getFrameDir
def SetupTimeDelNetSim():
# get Current Script Directory
CurrentScriptDir = getFrameDir()
# Initialize Directories relevant to CMake
CMakeModulesDir = os.path.join(CurrentScriptDir, 'CMakeModules')
CurrentSourceDir = CurrentScriptDir
BuildDir = os.path.join(os.getcwd(), 'TimeDelNetSim_build')
# Add CMakeModulesDir to sys path to get relevant functions
sys.path.insert(0, CMakeModulesDir)
from CMakePyHelper import getDefaultPlatformGen
from CMakePyHelper import CMakeGenCall, CMakeBuildCall
DefaultGenerator = getDefaultPlatformGen()
# generate and build
if not os.path.isdir(BuildDir):
os.mkdir(BuildDir)
with changedDir(BuildDir):
isCMakeGenSuccess = CMakeGenCall(CurrentSourceDir,
Generator=DefaultGenerator,
BuildConfig='Release',
Silent=True)
if isCMakeGenSuccess:
CMakeBuildSuccess = CMakeBuildCall(BuildDir,
Target='install',
BuildConfig='Release')
return CMakeBuildSuccess
if __name__ == "__main__":
SetupTimeDelNetSim()