aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-08-27 16:11:59 +0200
committerMohsin Kazmi <sykazmi@cisco.com>2018-08-27 16:28:15 +0200
commitf8520159d5e5b4988f56919d34aae3ee7ce38cdb (patch)
tree29af482860dd2f58dac646ea78a91076f7048e47 /src/cmake
parentb3abec7c1f936ee4950d14cc8a9c34c729551f9f (diff)
cmake: Fix plugins .h includes
Change-Id: I90600d000afb02e8969f3c01bcf9e4b5c10a7d39 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/plugin.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index a5b4bf51a16..6cae5e06ab4 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -15,16 +15,19 @@ macro(add_vpp_plugin name)
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 @@ macro(add_vpp_plugin name)
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})