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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 unset (VAPICLIENT_LIB)
23 find_library(VAPICLIENT_LIB NAMES vapiclient REQUIRED)
24 find_path(VAPICLIENT_INCLUDE_DIR NAMES vapi/vapi.hpp)
26 if(NOT VAPICLIENT_INCLUDE_DIR OR NOT VAPICLIENT_LIB)
27 message(FATAL_ERROR "Cannot find vapiclient library and/or headers")
30 include_directories(${VAPICLIENT_INCLUDE_DIR})
31 include_directories(${CMAKE_SOURCE_DIR})
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)
40 list(APPEND VOM_SOURCES
43 acl_ethertype_cmds.cpp
54 list(APPEND VOM_SOURCES
63 list(APPEND VOM_SOURCES
70 list(APPEND VOM_SOURCES
73 gbp_bridge_domain_cmds.cpp
77 gbp_endpoint_group_cmds.cpp
78 gbp_endpoint_group.cpp
81 gbp_route_domain_cmds.cpp
92 list(APPEND VOM_SOURCES
100 list(APPEND VOM_SOURCES
103 arp_proxy_binding_cmds.cpp
104 arp_proxy_binding.cpp
105 arp_proxy_config_cmds.cpp
107 bond_group_binding_cmds.cpp
108 bond_group_binding.cpp
109 bond_interface_cmds.cpp
112 bridge_domain_cmds.cpp
114 bridge_domain_arp_entry.cpp
115 bridge_domain_arp_entry_cmds.cpp
116 bridge_domain_entry_cmds.cpp
117 bridge_domain_entry.cpp
128 interface_factory.cpp
129 interface_ip6_nd_cmds.cpp
130 interface_span_cmds.cpp
133 ip_punt_redirect_cmds.cpp
135 ip_unnumbered_cmds.cpp
143 lldp_binding_cmds.cpp
160 route_domain_cmds.cpp
161 sub_interface_cmds.cpp
164 tap_interface_cmds.cpp
165 vxlan_tunnel_cmds.cpp
170 list(APPEND VOM_HEADERS
181 list(APPEND VOM_HEADERS
188 list(APPEND VOM_HEADERS
194 list(APPEND VOM_HEADERS
196 gbp_bridge_domain.hpp
198 gbp_endpoint_group.hpp
208 list(APPEND VOM_HEADERS
214 list(APPEND VOM_HEADERS
215 arp_proxy_binding.hpp
217 bond_group_binding.hpp
221 bridge_domain_arp_entry.hpp
222 bridge_domain_entry.hpp
255 singular_db_funcs.hpp
263 add_definitions(-Wall -Werror -std=gnu++11)
266 SOURCES ${VOM_SOURCES}
268 INSTALL_HEADERS ${VOM_HEADERS}
270 LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
271 ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt