cmake: Fix plugins .h includes
Change-Id: I90600d000afb02e8969f3c01bcf9e4b5c10a7d39
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index a5b4bf5..6cae5e0 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -15,16 +15,19 @@
cmake_parse_arguments(PLUGIN
""
"LINK_FLAGS"
- "SOURCES;API_FILES;MULTIARCH_SOURCES;LINK_LIBRARIES;API_TEST_SOURCES"
+ "SOURCES;API_FILES;MULTIARCH_SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;API_TEST_SOURCES"
${ARGN}
)
set(plugin_name ${name}_plugin)
set(api_headers)
file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
foreach(f ${PLUGIN_API_FILES})
+ get_filename_component(dir ${f} DIRECTORY)
vpp_generate_api_header(${f} plugins)
list(APPEND api_headers ${f}.h ${f}.json)
set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${f})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}.h DESTINATION
+ include/vpp_plugins/${name}/${dir})
endforeach()
add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_headers})
add_dependencies(${plugin_name} vpp_version_h api_headers)
@@ -40,6 +43,12 @@
if(PLUGIN_LINK_FLAGS)
set_target_properties(${plugin_name} PROPERTIES LINK_FLAGS "${PLUGIN_LINK_FLAGS}")
endif()
+ if(PLUGIN_INSTALL_HEADERS)
+ foreach(file ${PLUGIN_INSTALL_HEADERS})
+ get_filename_component(dir ${file} DIRECTORY)
+ install(FILES ${file} DESTINATION include/vpp_plugins/${name}/${dir})
+ endforeach()
+ endif()
if(PLUGIN_API_TEST_SOURCES)
set(test_plugin_name ${name}_test_plugin)
add_library(${test_plugin_name} SHARED ${PLUGIN_API_TEST_SOURCES} ${api_headers})