forked from davidcaron/pclpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkgconfig_utils.py
44 lines (36 loc) · 980 Bytes
/
pkgconfig_utils.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
import subprocess
PCL_VERSION = "1.9"
libs_to_build = [
'2d',
'common',
'features',
'filters',
'geometry',
'io',
'kdtree',
'keypoints',
'octree',
'recognition',
'sample_consensus',
'search',
'segmentation',
'stereo',
'surface',
'tracking',
# 'visualization',
]
pcl_libraries = ["pcl_%s-%s" % (lib, PCL_VERSION) for lib in libs_to_build]
def pkg_config_multi(arg, skip_chars=0):
output = []
for lib in pcl_libraries:
for value in pkg_config(arg, lib):
output.append(value[skip_chars:])
return list(set(output))
def pkg_config(arg, lib):
command = ["pkg-config", arg, lib]
output = subprocess.check_output(command).decode().strip()
return output.split()
def get_include_dir():
for path in pkg_config_multi("--cflags-only-I", skip_chars=2):
if path.endswith("pcl-%s" % PCL_VERSION):
return path