forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcm-create-cps.py
50 lines (46 loc) · 1.19 KB
/
lcm-create-cps.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
50
#!/usr/bin/env python
from cpsutils import read_defs
defs = read_defs("#define LCM_(VERSION[^\s]+)\s+([^\s]+)")
content = """
{
"Cps-Version": "0.8.0",
"Name": "lcm",
"Description": "Lightweight Communications and Marshaling library",
"License": "LGPL-2.1+",
"Version": "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s",
"Requires": {
"jchart2d": {
"Hints": ["@prefix@/lib/cmake/jchart2d"],
"X-CMake-Find-Args": [ "CONFIG" ]
}
},
"Default-Components": [ ":lcm" ],
"Components": {
"lcm-coretypes": {
"Type": "interface",
"Includes": [ "@prefix@/include" ]
},
"lcm": {
"Type": "dylib",
"Link-Flags": ["-lglib-2.0", "-lpthread"],
"Location": "@prefix@/lib/liblcm.so",
"Requires": [ ":lcm-coretypes" ]
},
"lcm-gen": {
"Type": "exe",
"Location": "@prefix@/bin/lcm-gen"
},
"lcm-java": {
"Type": "jar",
"Location": "@prefix@/share/java/lcm.jar",
"Requires": [ "jchart2d:jchart2d" ]
}
},
"X-CMake-Variables": {
"LCM_NAMESPACE": "lcm::",
"LCM_VERSION": "${lcm_VERSION}",
"LCM_USE_FILE": "${CMAKE_CURRENT_LIST_DIR}/lcmUtilities.cmake"
}
}
""" % defs
print(content[1:])