-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py.in
37 lines (28 loc) · 1.29 KB
/
config.py.in
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
source_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
vamos_buffers_DIR = "@vamos-buffers_DIR@"
vamos_buffers_BINARY_DIR = "@vamos-buffers_BINARY_DIR@"
vamos_buffers_SOURCE_DIR = "@vamos-buffers_SOURCE_DIR@"
vamos_buffers_LIBRARIES_DIRS_core = "@vamos-buffers_LIBRARIES_DIRS_core@"
vamos_buffers_LIBRARIES_DIRS_shmbuf = "@vamos-buffers_LIBRARIES_DIRS_shmbuf@"
vamos_buffers_LIBRARIES_DIRS_streams = "@vamos-buffers_LIBRARIES_DIRS_streams@"
vamos_buffers_INCLUDE_DIR = "@vamos-buffers_DIR@/../../include"
vamos_buffers_BUILD_TYPE = "@vamos-buffers_BUILD_TYPE@"
vamos_buffers_C_COMPILER = "@vamos-buffers_C_COMPILER@"
vamos_buffers_OPTION_ENABLE_IPO = "@vamos-buffers_OPTION_ENABLE_IPO@".upper()
vamos_common_PYTHONPATH = "@vamos-common_PYTHONPATH@"
from os.path import dirname
def get_cmake_var(name):
cache = "@CMAKE_CURRENT_SOURCE_DIR@/CMakeCache.txt"
with open(cache, "r") as f:
for line in f:
if line.startswith(name):
parts = line.split("=", 3)
if len(parts) != 3:
continue
lhs = parts[0]
if ":" in lhs:
lhs = lhs[:lhs.find(":")]
if lhs != name:
continue
return parts[2]
return None