summaryrefslogtreecommitdiffstats
path: root/hicn-plugin
diff options
context:
space:
mode:
authorLuca Muscariello <lumuscar+fdio@cisco.com>2019-02-15 21:19:02 +0100
committerLuca Muscariello <lumuscar+fdio@cisco.com>2019-02-18 11:13:06 +0100
commit75af12024ef5c33040e0771972e3fce01e48a9e4 (patch)
tree4818a857b80045071b98073d5a1c8de84726b775 /hicn-plugin
parent7d2b217bd01a8da1a2ac57aaad59b3179c7af916 (diff)
[HICN-35] add vapi
Change-Id: I34dfeb05b2d2796129e68c3f38d73f1ec49699a1 Signed-off-by: Luca Muscariello <lumuscar+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin')
-rw-r--r--hicn-plugin/CMakeLists.txt31
1 files changed, 28 insertions, 3 deletions
diff --git a/hicn-plugin/CMakeLists.txt b/hicn-plugin/CMakeLists.txt
index aaa4136ff..1cd6f0411 100644
--- a/hicn-plugin/CMakeLists.txt
+++ b/hicn-plugin/CMakeLists.txt
@@ -179,6 +179,10 @@ set(HICN_API_TEST_HEADER_FILES
set(HICN_API_GENERATED_FILES
${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h)
+set(HICN_VAPI_GENERATED_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.h
+ ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.hpp)
+
if (NOT VPP_HOME)
set(VPP_HOME /usr)
endif()
@@ -197,9 +201,25 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
endif()
execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/hicn)
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h
+# These files are missing from vpp binary distribution
+execute_process(
+ COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_json_parser.py?h=stable/1901 -o ${CMAKE_BINARY_DIR}/vapi_json_parser.py
+ COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_c_gen.py?h=stable/1901 -o ${CMAKE_BINARY_DIR}/vapi_c_gen.py
+ COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_cpp_gen.py?h=stable/1901 -o ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py
+ )
+
+add_custom_command(
+ COMMAND chmod +x ${CMAKE_BINARY_DIR}/vapi_json_parser.py ${CMAKE_BINARY_DIR}/vapi_c_gen.py ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h
COMMAND ${VPP_HOME}/bin/vppapigen --input ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api --output ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.h
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api)
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json
+ COMMAND ${VPP_HOME}/bin/vppapigen JSON --input ${CMAKE_CURRENT_SOURCE_DIR}/src/hicn.api --output ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.h
+ COMMAND ${CMAKE_BINARY_DIR}/vapi_c_gen.py ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.vapi.hpp
+ COMMAND ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn/hicn.api.json
+ )
include_directories(SYSTEM)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@@ -208,7 +228,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHICN_VPP_PLUGIN=1")
add_library(hicn_plugin SHARED
${LIBHICN_FILES}
${HICN_PLUGIN_SOURCE_FILES}
- ${HICN_API_GENERATED_FILES})
+ ${HICN_API_GENERATED_FILES}
+ ${HICN_VAPI_GENERATED_FILES})
file(COPY ${HICN_API_TEST_HEADER_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins/hicn)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/vpp_plugins)
@@ -250,4 +271,8 @@ install(TARGETS hicn_api_test_plugin
install(FILES ${HICN_API_TEST_HEADER_FILES} ${HICN_API_GENERATED_FILES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vpp_plugins/hicn
+ COMPONENT ${HICN_PLUGIN})
+
+install(FILES ${HICN_VAPI_GENERATED_FILES}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vapi
COMPONENT ${HICN_PLUGIN}) \ No newline at end of file