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
77 gbp_endpoint_group_cmds.cpp
78 gbp_endpoint_group.cpp
85 list(APPEND VOM_SOURCES
93 list(APPEND VOM_SOURCES
96 arp_proxy_binding_cmds.cpp
98 arp_proxy_config_cmds.cpp
100 bond_group_binding_cmds.cpp
101 bond_group_binding.cpp
102 bond_interface_cmds.cpp
105 bridge_domain_cmds.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
121 interface_factory.cpp
122 interface_ip6_nd_cmds.cpp
123 interface_span_cmds.cpp
126 ip_punt_redirect_cmds.cpp
128 ip_unnumbered_cmds.cpp
136 lldp_binding_cmds.cpp
153 route_domain_cmds.cpp
154 sub_interface_cmds.cpp
157 tap_interface_cmds.cpp
158 vxlan_tunnel_cmds.cpp
163 list(APPEND VOM_HEADERS
174 list(APPEND VOM_HEADERS
181 list(APPEND VOM_HEADERS
187 list(APPEND VOM_HEADERS
189 gbp_endpoint_group.hpp
197 list(APPEND VOM_HEADERS
203 list(APPEND VOM_HEADERS
204 arp_proxy_binding.hpp
206 bond_group_binding.hpp
210 bridge_domain_arp_entry.hpp
211 bridge_domain_entry.hpp
244 singular_db_funcs.hpp
252 add_definitions(-Wall -Werror -std=gnu++11)
255 SOURCES ${VOM_SOURCES}
257 INSTALL_HEADERS ${VOM_HEADERS}
259 LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread
260 ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt