X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2FCMakeLists.txt;h=26dd3e465742aafed61a50920d8af5133639fcfd;hb=32f6d8e0c;hp=47e73b6e7a0f9ba4e924795bd749d0cae0c34a21;hpb=193c47d900bfbc15e4e46ede7c25ecf1ca95b898;p=vpp.git diff --git a/extras/vom/vom/CMakeLists.txt b/extras/vom/vom/CMakeLists.txt index 47e73b6e7a0..26dd3e46574 100644 --- a/extras/vom/vom/CMakeLists.txt +++ b/extras/vom/vom/CMakeLists.txt @@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +unset (VPPAPICLIENT_LIB) unset (VAPICLIENT_LIB) unset (ACL_FILE) unset (NAT_FILE) @@ -20,13 +21,20 @@ unset (IGMP_FILE) unset (VOM_SOURCES) unset (VOM_HEADERS) +find_library(VPPAPICLIENT_LIB NAMES vppapiclient REQUIRED) +find_path(VPPAPICLIENT_INCLUDE_DIR NAMES vpp-api/client/vppapiclient.h) find_library(VAPICLIENT_LIB NAMES vapiclient REQUIRED) find_path(VAPICLIENT_INCLUDE_DIR NAMES vapi/vapi.hpp) + +if(NOT VPPAPICLIENT_INCLUDE_DIR OR NOT VPPAPICLIENT_LIB) + message(FATAL_ERROR "Cannot find vppapiclient library and/or headers") +endif() if(NOT VAPICLIENT_INCLUDE_DIR OR NOT VAPICLIENT_LIB) message(FATAL_ERROR "Cannot find vapiclient library and/or headers") endif() +include_directories(${VPPAPICLIENT_INCLUDE_DIR}) include_directories(${VAPICLIENT_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}) @@ -42,10 +50,11 @@ if(ACL_FILE) acl_binding.cpp acl_ethertype_cmds.cpp acl_ethertype.cpp + acl_l2_list.cpp acl_l2_rule.cpp + acl_l3_list.cpp acl_l3_rule.cpp acl_list_cmds.cpp - acl_list.cpp acl_types.cpp ) endif() @@ -138,6 +147,8 @@ list(APPEND VOM_SOURCES ip_unnumbered.cpp l2_binding_cmds.cpp l2_binding.cpp + l2_vtr.cpp + l2_vtr_cmds.cpp l2_xconnect_cmds.cpp l2_xconnect.cpp l3_binding_cmds.cpp @@ -150,6 +161,7 @@ list(APPEND VOM_SOURCES neighbour.cpp neighbour_cmds.cpp object_base.cpp + mroute_cmds.cpp om.cpp pipe.cpp pipe_cmds.cpp @@ -157,9 +169,12 @@ list(APPEND VOM_SOURCES ra_config.cpp ra_prefix.cpp route.cpp + route_api_types.cpp route_cmds.cpp route_domain.cpp route_domain_cmds.cpp + stat_client.cpp + stat_reader.cpp sub_interface_cmds.cpp sub_interface.cpp tap_interface.cpp @@ -175,7 +190,8 @@ if(ACL_FILE) acl_ethertype.hpp acl_l2_rule.hpp acl_l3_rule.hpp - acl_list.hpp + acl_l3_list.hpp + acl_l2_list.hpp acl_types.hpp ) endif() @@ -240,6 +256,7 @@ list(APPEND VOM_HEADERS ip_punt_redirect.hpp ip_unnumbered.hpp l2_binding.hpp + l2_vtr.hpp l2_xconnect.hpp l3_binding.hpp lldp_binding.hpp @@ -257,6 +274,8 @@ list(APPEND VOM_HEADERS rpc_cmd.hpp singular_db.hpp singular_db_funcs.hpp + stat_client.hpp + stat_reader.hpp sub_interface.hpp tap_interface.hpp types.hpp @@ -265,14 +284,23 @@ list(APPEND VOM_HEADERS ) add_definitions(-Wall -Werror -std=gnu++11) +add_library(vom SHARED ${VOM_SOURCES}) +if (VOM_LIB_VERSION) + set_target_properties(vom PROPERTIES SOVERSION ${VOM_LIB_VERSION}) +endif() +target_link_libraries(vom ${VPPAPICLIENT_LIB} ${VAPICLIENT_LIB} Threads::Threads + ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} m rt) +install(TARGETS vom DESTINATION lib COMPONENT vom) +install(FILES ${VOM_HEADERS} DESTINATION include/vom COMPONENT vom) -add_vpp_library(vom - SOURCES ${VOM_SOURCES} - - INSTALL_HEADERS ${VOM_HEADERS} - - LINK_LIBRARIES ${VAPICLIENT_LIB} Threads::Threads boost_thread - ${BOOST_SYSTEM_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_ASIO_LIB} m rt - - COMPONENT libvom -) +if (Boost_FOUND) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_definitions(-stdlib=libstdc++) + endif() + add_executable(vom_stats_test test_stats.cpp) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + target_link_libraries(vom_stats_test vom stdc++) + else() + target_link_libraries(vom_stats_test vom) + endif() +endif()