GBP Endpoint Learning
[vpp.git] / extras / vom / vom / CMakeLists.txt
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 unset (VAPICLIENT_LIB)
15 unset (ACL_FILE)
16 unset (NAT_FILE)
17 unset (L2E_FILE)
18 unset (GBP_FILE)
19 unset (IGMP_FILE)
20 unset (VOM_SOURCES)
21 unset (VOM_HEADERS)
22
23 find_library(VAPICLIENT_LIB NAMES vapiclient REQUIRED)
24 find_path(VAPICLIENT_INCLUDE_DIR NAMES vapi/vapi.hpp)
25
26 if(NOT VAPICLIENT_INCLUDE_DIR OR NOT VAPICLIENT_LIB)
27   message(FATAL_ERROR "Cannot find vapiclient library and/or headers")
28 endif()
29
30 include_directories(${VAPICLIENT_INCLUDE_DIR})
31 include_directories(${CMAKE_SOURCE_DIR})
32
33 find_file(ACL_FILE NAMES acl.api.vapi.hpp PATH_SUFFIXES vapi)
34 find_file(NAT_FILE NAMES nat.api.vapi.hpp PATH_SUFFIXES vapi)
35 find_file(L2E_FILE NAMES l2e.api.vapi.hpp PATH_SUFFIXES vapi)
36 find_file(GBP_FILE NAMES gbp.api.vapi.hpp PATH_SUFFIXES vapi)
37 find_file(IGMP_FILE NAMES igmp.api.vapi.hpp PATH_SUFFIXES vapi)
38
39 if(ACL_FILE)
40   list(APPEND VOM_SOURCES
41     acl_binding_cmds.cpp
42     acl_binding.cpp
43     acl_ethertype_cmds.cpp
44     acl_ethertype.cpp
45     acl_l2_rule.cpp
46     acl_l3_rule.cpp
47     acl_list_cmds.cpp
48     acl_list.cpp
49     acl_types.cpp
50   )
51 endif()
52
53 if(NAT_FILE)
54   list(APPEND VOM_SOURCES
55     nat_static.cpp
56     nat_static_cmds.cpp
57     nat_binding.cpp
58     nat_binding_cmds.cpp
59   )
60 endif()
61
62 if (L2E_FILE)
63   list(APPEND VOM_SOURCES
64     l2_emulation_cmds.cpp
65     l2_emulation.cpp
66   )
67 endif()
68
69 if(GBP_FILE)
70   list(APPEND VOM_SOURCES
71     gbp_contract_cmds.cpp
72     gbp_contract.cpp
73     gbp_bridge_domain_cmds.cpp
74     gbp_bridge_domain.cpp
75     gbp_endpoint_cmds.cpp
76     gbp_endpoint.cpp
77     gbp_endpoint_group_cmds.cpp
78     gbp_endpoint_group.cpp
79     gbp_recirc_cmds.cpp
80     gbp_recirc.cpp
81     gbp_route_domain_cmds.cpp
82     gbp_route_domain.cpp
83     gbp_subnet_cmds.cpp
84     gbp_subnet.cpp
85     gbp_vxlan.cpp
86     gbp_vxlan_cmds.cpp
87   )
88 endif()
89
90 if (IGMP_FILE)
91   list(APPEND VOM_SOURCES
92     igmp_binding_cmds.cpp
93     igmp_binding.cpp
94     igmp_listen_cmds.cpp
95     igmp_listen.cpp
96   )
97 endif()
98
99 list(APPEND VOM_SOURCES
100   types.cpp
101   api_types.cpp
102   arp_proxy_binding_cmds.cpp
103   arp_proxy_binding.cpp
104   arp_proxy_config_cmds.cpp
105   arp_proxy_config.cpp
106   bond_group_binding_cmds.cpp
107   bond_group_binding.cpp
108   bond_interface_cmds.cpp
109   bond_interface.cpp
110   bond_member.cpp
111   bridge_domain_cmds.cpp
112   bridge_domain.cpp
113   bridge_domain_arp_entry.cpp
114   bridge_domain_arp_entry_cmds.cpp
115   bridge_domain_entry_cmds.cpp
116   bridge_domain_entry.cpp
117   client_db.cpp
118   cmd.cpp
119   connection.cpp
120   dhcp_client_cmds.cpp
121   dhcp_client.cpp
122   hw_cmds.cpp
123   hw.cpp
124   inspect.cpp
125   interface_cmds.cpp
126   interface.cpp
127   interface_factory.cpp
128   interface_ip6_nd_cmds.cpp
129   interface_span_cmds.cpp
130   interface_span.cpp
131   interface_types.cpp
132   ip_punt_redirect_cmds.cpp
133   ip_punt_redirect.cpp
134   ip_unnumbered_cmds.cpp
135   ip_unnumbered.cpp
136   l2_binding_cmds.cpp
137   l2_binding.cpp
138   l2_xconnect_cmds.cpp
139   l2_xconnect.cpp
140   l3_binding_cmds.cpp
141   l3_binding.cpp
142   lldp_binding_cmds.cpp
143   lldp_binding.cpp
144   lldp_global_cmds.cpp
145   lldp_global.cpp
146   logger.cpp
147   neighbour.cpp
148   neighbour_cmds.cpp
149   object_base.cpp
150   om.cpp
151   pipe.cpp
152   pipe_cmds.cpp
153   prefix.cpp
154   ra_config.cpp
155   ra_prefix.cpp
156   route.cpp
157   route_cmds.cpp
158   route_domain.cpp
159   route_domain_cmds.cpp
160   sub_interface_cmds.cpp
161   sub_interface.cpp
162   tap_interface.cpp
163   tap_interface_cmds.cpp
164   vxlan_tunnel_cmds.cpp
165   vxlan_tunnel.cpp
166 )
167
168 if(ACL_FILE)
169   list(APPEND VOM_HEADERS
170     acl_binding.hpp
171     acl_ethertype.hpp
172     acl_l2_rule.hpp
173     acl_l3_rule.hpp
174     acl_list.hpp
175     acl_types.hpp
176   )
177 endif()
178
179 if(NAT_FILE)
180   list(APPEND VOM_HEADERS
181     nat_static.hpp
182     nat_binding.hpp
183   )
184 endif()
185
186 if(L2E_FILE)
187   list(APPEND VOM_HEADERS
188     l2_emulation.hpp
189   )
190 endif()
191
192 if(GBP_FILE)
193   list(APPEND VOM_HEADERS
194     gbp_endpoint.hpp
195     gbp_endpoint_group.hpp
196     gbp_subnet.hpp
197     gbp_recirc.hpp
198     gbp_contract.hpp
199   )
200 endif()
201
202 if(IGMP_FILE)
203   list(APPEND VOM_HEADERS
204     igmp_binding.hpp
205     igmp_listen.hpp
206   )
207 endif()
208
209 list(APPEND VOM_HEADERS
210   arp_proxy_binding.hpp
211   arp_proxy_config.hpp
212   bond_group_binding.hpp
213   bond_interface.hpp
214   bond_member.hpp
215   bridge_domain.hpp
216   bridge_domain_arp_entry.hpp
217   bridge_domain_entry.hpp
218   client_db.hpp
219   cmd.hpp
220   connection.hpp
221   dhcp_client.hpp
222   dump_cmd.hpp
223   enum_base.hpp
224   event_cmd.hpp
225   hw.hpp
226   inspect.hpp
227   interface.hpp
228   interface_cmds.hpp
229   interface_ip6_nd.hpp
230   interface_span.hpp
231   ip_punt_redirect.hpp
232   ip_unnumbered.hpp
233   l2_binding.hpp
234   l2_xconnect.hpp
235   l3_binding.hpp
236   lldp_binding.hpp
237   lldp_global.hpp
238   logger.hpp
239   neighbour.hpp
240   object_base.hpp
241   om.hpp
242   pipe.hpp
243   prefix.hpp
244   ra_config.hpp
245   ra_prefix.hpp
246   route.hpp
247   route_domain.hpp
248   rpc_cmd.hpp
249   singular_db.hpp
250   singular_db_funcs.hpp
251   sub_interface.hpp
252   tap_interface.hpp
253   types.hpp
254   api_types.hpp
255   vxlan_tunnel.hpp
256 )
257
258 add_definitions(-Wall -Werror -std=gnu++11)
259
260 add_vpp_library(vom
261   SOURCES ${VOM_SOURCES}
262
263   INSTALL_HEADERS ${VOM_HEADERS}
264
265   LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
266     ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt
267
268   COMPONENT libvom
269 )