aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake/plugin.cmake
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-08-29 22:20:45 +0200
committerDamjan Marion <dmarion@me.com>2018-08-30 12:35:28 +0000
commit43b06063015abfa42bc9c5ab925cd6b7ea3cbf42 (patch)
treef7e1acfeae68735929ebaccf5fe1eb1b8f86ee0e /src/cmake/plugin.cmake
parentec2a9bbb89a4ec1ebf8982f1d611179cd84315b8 (diff)
cmake: a bit of packaging work
Change-Id: I40332c2348c4aab873d726532f2ac3c4abde7ec9 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/cmake/plugin.cmake')
-rw-r--r--src/cmake/plugin.cmake31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index a0442394092..9f9a6460f0f 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -14,7 +14,7 @@
macro(add_vpp_plugin name)
cmake_parse_arguments(PLUGIN
""
- "LINK_FLAGS"
+ "LINK_FLAGS;COMPONENT"
"SOURCES;API_FILES;MULTIARCH_SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;API_TEST_SOURCES"
${ARGN}
)
@@ -26,8 +26,11 @@ macro(add_vpp_plugin name)
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})
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}.h
+ DESTINATION include/vpp_plugins/${name}/${dir}
+ COMPONENT vpp-dev
+ )
endforeach()
add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_headers})
target_compile_options(${plugin_name} PRIVATE -Wall)
@@ -47,9 +50,16 @@ macro(add_vpp_plugin name)
if(PLUGIN_INSTALL_HEADERS)
foreach(file ${PLUGIN_INSTALL_HEADERS})
get_filename_component(dir ${file} DIRECTORY)
- install(FILES ${file} DESTINATION include/vpp_plugins/${name}/${dir})
+ install(
+ FILES ${file}
+ DESTINATION include/vpp_plugins/${name}/${dir}
+ COMPONENT vpp-dev
+ )
endforeach()
endif()
+ if(NOT PLUGIN_COMPONENT)
+ set(PLUGIN_COMPONENT vpp-plugin-misc)
+ 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})
@@ -57,9 +67,16 @@ macro(add_vpp_plugin name)
set_target_properties(${test_plugin_name} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vpp_api_test_plugins)
- install(TARGETS ${test_plugin_name} DESTINATION ${VPP_LIB_DIR_NAME}/vpp_api_test_plugins COMPONENT
- plugins)
+ install(
+ TARGETS ${test_plugin_name}
+ DESTINATION ${VPP_LIB_DIR_NAME}/vpp_api_test_plugins
+ COMPONENT ${PLUGIN_COMPONENT}
+ )
endif()
- install(TARGETS ${plugin_name} DESTINATION ${VPP_LIB_DIR_NAME}/vpp_plugins COMPONENT plugins)
+ install(
+ TARGETS ${plugin_name}
+ DESTINATION ${VPP_LIB_DIR_NAME}/vpp_plugins
+ COMPONENT ${PLUGIN_COMPONENT}
+ )
endmacro()