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)
22 find_library(VAPICLIENT_LIB NAMES vapiclient REQUIRED)
23 find_path(VAPICLIENT_INCLUDE_DIR NAMES vapi/vapi.hpp)
25 if(NOT VAPICLIENT_INCLUDE_DIR OR NOT VAPICLIENT_LIB)
26 message(FATAL_ERROR "Cannot find vapiclient library and/or headers")
29 include_directories(${VAPICLIENT_INCLUDE_DIR})
30 include_directories(${CMAKE_SOURCE_DIR})
32 find_file(ACL_FILE NAMES acl.api.vapi.hpp PATH_SUFFIXES vapi)
33 find_file(NAT_FILE NAMES nat.api.vapi.hpp PATH_SUFFIXES vapi)
34 find_file(L2E_FILE NAMES l2e.api.vapi.hpp PATH_SUFFIXES vapi)
35 find_file(GBP_FILE NAMES gbp.api.vapi.hpp PATH_SUFFIXES vapi)
38 list(APPEND VOM_SOURCES
41 acl_ethertype_cmds.cpp
52 list(APPEND VOM_SOURCES
61 list(APPEND VOM_SOURCES
68 list(APPEND VOM_SOURCES
75 gbp_endpoint_group_cmds.cpp
76 gbp_endpoint_group.cpp
82 list(APPEND VOM_SOURCES
85 arp_proxy_binding_cmds.cpp
87 arp_proxy_config_cmds.cpp
89 bond_group_binding_cmds.cpp
90 bond_group_binding.cpp
91 bond_interface_cmds.cpp
94 bridge_domain_cmds.cpp
96 bridge_domain_arp_entry.cpp
97 bridge_domain_arp_entry_cmds.cpp
98 bridge_domain_entry_cmds.cpp
99 bridge_domain_entry.cpp
110 interface_factory.cpp
111 interface_ip6_nd_cmds.cpp
112 interface_span_cmds.cpp
115 ip_unnumbered_cmds.cpp
123 lldp_binding_cmds.cpp
140 route_domain_cmds.cpp
141 sub_interface_cmds.cpp
144 tap_interface_cmds.cpp
145 vxlan_tunnel_cmds.cpp
150 list(APPEND VOM_HEADERS
161 list(APPEND VOM_HEADERS
168 list(APPEND VOM_HEADERS
174 list(APPEND VOM_HEADERS
176 gbp_endpoint_group.hpp
183 list(APPEND VOM_HEADERS
184 arp_proxy_binding.hpp
186 bond_group_binding.hpp
190 bridge_domain_arp_entry.hpp
191 bridge_domain_entry.hpp
223 singular_db_funcs.hpp
231 add_library(vom SHARED ${VOM_SOURCES})
232 target_link_libraries(vom ${VAPICLIENT_LIB} Threads::Threads boost_thread
233 ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt)
234 add_definitions(-Wall -Werror -std=gnu++11)
235 install(TARGETS vom DESTINATION lib)
237 foreach(file ${VOM_HEADERS})
238 install(FILES ${file} DESTINATION include/vom)