forked from JdeRobot/base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildpresets.cmake
120 lines (94 loc) · 2.88 KB
/
buildpresets.cmake
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Copyright (C) 2015 JDE Developers Team
# Authors:
# Victor Arribas <[email protected]>
# Francisco Perez <[email protected]>
## New alias for build-default
if (build_all)
set(build-default ON)
return()
endif()
### Notice: definition should be from large to core to allow chainning
## A run once macro to add suffix to project name ;)
macro (project_suffix suffix)
if (NOT _project_suffix_done)
project(${PROJECT_NAME}-${suffix})
set(_project_suffix_done ON)
endif()
endmacro()
## CMakeCache is a bad friend for this feature. Tweak it to avoid
function (build_component component value)
if (NOT DEFINED build_${component})
set(build_${component} ${value} CACHE BOOL "Build flag for JdeRobot component: ${component} (defined by builtpresets)" ${ARGS})
elseif (NOT build_${component} EQUAL ${value})
set(build_${component} ${value} CACHE BOOL "Build flag for JdeRobot component: ${component} (overriden by builtpresets)" FORCE ${ARGS})
endif()
endfunction()
## Tests
if (test_ardrone)
build_component(ardrone_server ON)
build_component(introrob_py ON)
build_component(core ON)
endif()
if (test_quadrotor)
build_component(gazeboserver ON)
build_component(quadrotor2 ON)
build_component(quadrotor ON)
build_component(introrob_py ON)
build_component(core ON)
endif()
if (test_car)
build_component(gazeboserver ON)
build_component(car ON)
build_component(introrob_qt ON)
build_component(core ON)
endif()
if (test_flyingKinect)
build_component(gazeboserver ON)
build_component(flyingKinect ON)
build_component(flyingKinect2 ON)
build_component(quadrotor2 ON) # dependency
build_component(navigatorCamera ON)
build_component(rgbdViewer ON)
build_component(core ON)
endif()
## Build aliases (real packages for cpack)
if (build_drivers)
project_suffix(drivers)
set(build-default OFF)
build_component(core ON)
# todo: core drivers
build_component(ardrone_server ON)
build_component(basic_server ON)
build_component(cameraserver ON)
build_component(gazeboserver ON)
build_component(car ON)
build_component(flyingKinect ON)
build_component(kinect ON)
build_component(nao ON)
build_component(pioneer ON)
build_component(quadrotor ON)
build_component(quadrotor2 ON)
build_component(turtlebot ON)
build_component(giraffeServer ON)
build_component(kinect2server ON)
build_component(kobuki_driver ON)
build_component(naoserver ON)
build_component(openni1Server ON)
build_component(openniServer ON)
build_component(pclRGBDServer ON)
endif()
if (build_core)
project_suffix(core)
set(build-default OFF)
build_component(msgs ON)
# libs are included by default at now
endif()
if (build_msgs)
project_suffix(msgs)
set(build-default OFF)
build_component(interfaces_cpp ON)
build_component(interfaces_java ON)
build_component(interfaces_python ON)
# todo: remove libs from this build flavor
endif()
#message(SEND_ERROR "PROJECT_NAME: ${PROJECT_NAME}")