-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.py
executable file
·37 lines (30 loc) · 1010 Bytes
/
project.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
#!/usr/bin/env python
#-*- coding = utf-8 -*-
#
# @file from https://github.com/Neutree/c_cpp_project_framework
# @author neucrack
# @license Apache 2.0
#
import sys, os
sdk_env_name = "MY_SDK_PATH"
custom_component_path_name = "CUSTOM_COMPONENTS_PATH"
# get SDK absolute path
sdk_path = os.path.abspath(sys.path[0]+"/../../")
try:
if os.environ[sdk_env_name] and os.path.exists(os.environ[sdk_env_name]):
sdk_path = os.environ[sdk_env_name]
except Exception:
pass
print("-- SDK_PATH:{}".format(sdk_path))
# get custom components path
custom_components_path = None
try:
if os.environ[custom_component_path_name] and os.path.exists(os.environ[custom_component_path_name]):
custom_components_path = os.environ[custom_component_path_name]
except Exception:
pass
print("-- CUSTOM_COMPONENTS_PATH:{}".format(custom_components_path))
# execute project script from SDK
project_file_path = sdk_path+"/tools/cmake/project.py"
with open(project_file_path) as f:
exec(f.read())