vom: Add igmp 'host' support in vom
[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_recirc_cmds.cpp
72     gbp_recirc.cpp
73     gbp_subnet_cmds.cpp
74     gbp_subnet.cpp
75     gbp_endpoint_cmds.cpp
76     gbp_endpoint.cpp
77     gbp_endpoint_group_cmds.cpp
78     gbp_endpoint_group.cpp
79     gbp_contract_cmds.cpp
80     gbp_contract.cpp
81   )
82 endif()
83
84 if (IGMP_FILE)
85   list(APPEND VOM_SOURCES
86     igmp_binding_cmds.cpp
87     igmp_binding.cpp
88     igmp_listen_cmds.cpp
89     igmp_listen.cpp
90   )
91 endif()
92
93 list(APPEND VOM_SOURCES
94   types.cpp
95   api_types.cpp
96   arp_proxy_binding_cmds.cpp
97   arp_proxy_binding.cpp
98   arp_proxy_config_cmds.cpp
99   arp_proxy_config.cpp
100   bond_group_binding_cmds.cpp
101   bond_group_binding.cpp
102   bond_interface_cmds.cpp
103   bond_interface.cpp
104   bond_member.cpp
105   bridge_domain_cmds.cpp
106   bridge_domain.cpp
107   bridge_domain_arp_entry.cpp
108   bridge_domain_arp_entry_cmds.cpp
109   bridge_domain_entry_cmds.cpp
110   bridge_domain_entry.cpp
111   client_db.cpp
112   cmd.cpp
113   connection.cpp
114   dhcp_client_cmds.cpp
115   dhcp_client.cpp
116   hw_cmds.cpp
117   hw.cpp
118   inspect.cpp
119   interface_cmds.cpp
120   interface.cpp
121   interface_factory.cpp
122   interface_ip6_nd_cmds.cpp
123   interface_span_cmds.cpp
124   interface_span.cpp
125   interface_types.cpp
126   ip_punt_redirect_cmds.cpp
127   ip_punt_redirect.cpp
128   ip_unnumbered_cmds.cpp
129   ip_unnumbered.cpp
130   l2_binding_cmds.cpp
131   l2_binding.cpp
132   l2_xconnect_cmds.cpp
133   l2_xconnect.cpp
134   l3_binding_cmds.cpp
135   l3_binding.cpp
136   lldp_binding_cmds.cpp
137   lldp_binding.cpp
138   lldp_global_cmds.cpp
139   lldp_global.cpp
140   logger.cpp
141   neighbour.cpp
142   neighbour_cmds.cpp
143   object_base.cpp
144   om.cpp
145   pipe.cpp
146   pipe_cmds.cpp
147   prefix.cpp
148   ra_config.cpp
149   ra_prefix.cpp
150   route.cpp
151   route_cmds.cpp
152   route_domain.cpp
153   route_domain_cmds.cpp
154   sub_interface_cmds.cpp
155   sub_interface.cpp
156   tap_interface.cpp
157   tap_interface_cmds.cpp
158   vxlan_tunnel_cmds.cpp
159   vxlan_tunnel.cpp
160 )
161
162 if(ACL_FILE)
163   list(APPEND VOM_HEADERS
164     acl_binding.hpp
165     acl_ethertype.hpp
166     acl_l2_rule.hpp
167     acl_l3_rule.hpp
168     acl_list.hpp
169     acl_types.hpp
170   )
171 endif()
172
173 if(NAT_FILE)
174   list(APPEND VOM_HEADERS
175     nat_static.hpp
176     nat_binding.hpp
177   )
178 endif()
179
180 if(L2E_FILE)
181   list(APPEND VOM_HEADERS
182     l2_emulation.hpp
183   )
184 endif()
185
186 if(GBP_FILE)
187   list(APPEND VOM_HEADERS
188     gbp_endpoint.hpp
189     gbp_endpoint_group.hpp
190     gbp_subnet.hpp
191     gbp_recirc.hpp
192     gbp_contract.hpp
193   )
194 endif()
195
196 if(IGMP_FILE)
197   list(APPEND VOM_HEADERS
198     igmp_binding.hpp
199     igmp_listen.hpp
200   )
201 endif()
202
203 list(APPEND VOM_HEADERS
204   arp_proxy_binding.hpp
205   arp_proxy_config.hpp
206   bond_group_binding.hpp
207   bond_interface.hpp
208   bond_member.hpp
209   bridge_domain.hpp
210   bridge_domain_arp_entry.hpp
211   bridge_domain_entry.hpp
212   client_db.hpp
213   cmd.hpp
214   connection.hpp
215   dhcp_client.hpp
216   dump_cmd.hpp
217   enum_base.hpp
218   event_cmd.hpp
219   hw.hpp
220   inspect.hpp
221   interface.hpp
222   interface_cmds.hpp
223   interface_ip6_nd.hpp
224   interface_span.hpp
225   ip_punt_redirect.hpp
226   ip_unnumbered.hpp
227   l2_binding.hpp
228   l2_xconnect.hpp
229   l3_binding.hpp
230   lldp_binding.hpp
231   lldp_global.hpp
232   logger.hpp
233   neighbour.hpp
234   object_base.hpp
235   om.hpp
236   pipe.hpp
237   prefix.hpp
238   ra_config.hpp
239   ra_prefix.hpp
240   route.hpp
241   route_domain.hpp
242   rpc_cmd.hpp
243   singular_db.hpp
244   singular_db_funcs.hpp
245   sub_interface.hpp
246   tap_interface.hpp
247   types.hpp
248   api_types.hpp
249   vxlan_tunnel.hpp
250 )
251
252 add_definitions(-Wall -Werror -std=gnu++11)
253
254 add_vpp_library(vom
255   SOURCES ${VOM_SOURCES}
256
257   INSTALL_HEADERS ${VOM_HEADERS}
258
259   LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
260     ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt
261
262   COMPONENT libvom
263 )