From eeadc14ee2c945eb53ae4cc3c6262499e896afb5 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 13 Sep 2018 20:02:12 +0200 Subject: cpack: add deb/rpm packaging to VPP module This allows easy packaging of external projects, including VOM and sample plugin. i.e. $ make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install $ ninja -C build-root/build-vpp-native/sample-plugin package ninja: Entering directory `build-root/build-vpp-native/sample-plugin' [0/1] Run CPack packaging tool... CPack: Create package using DEB CPack: Install projects CPack: - Install project: sample-plugin CPack: - Install component: vpp-plugin-sample CPack: - Install component: vpp-plugin-sample-dev CPack: Create package CPack: - package: build-root/build-vpp-native/sample-plugin/vpp-plugin-sample_18.10~rc0~413~g1433e9d1-1_amd64.deb generated. CPack: - package: build-root/build-vpp-native/sample-plugin/vpp-plugin-sample-dev_18.10~rc0~413~g1433e9d1-1_amd64.deb generated. Change-Id: I6b3ec2433961e53edd976b19659ce214d272c40a Signed-off-by: Damjan Marion --- src/cmake/plugin.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/cmake/plugin.cmake') diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake index f68c955f64f..1cff910db5f 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;COMPONENT" + "LINK_FLAGS;COMPONENT;DEV_COMPONENT" "SOURCES;API_FILES;MULTIARCH_SOURCES;LINK_LIBRARIES;INSTALL_HEADERS;API_TEST_SOURCES" ${ARGN} ) @@ -23,6 +23,14 @@ macro(add_vpp_plugin name) if(NOT PLUGIN_COMPONENT) set(PLUGIN_COMPONENT vpp-plugin-misc) endif() + if(NOT PLUGIN_DEV_COMPONENT) + if(NOT VPP_EXTERNAL_PROJECT) + set(PLUGIN_DEV_COMPONENT vpp-dev) + else() + set(PLUGIN_DEV_COMPONENT ${PLUGIN_COMPONENT}-dev) + endif() + endif() + file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) foreach(f ${PLUGIN_API_FILES}) get_filename_component(dir ${f} DIRECTORY) @@ -32,7 +40,7 @@ macro(add_vpp_plugin name) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}.h DESTINATION include/vpp_plugins/${name}/${dir} - COMPONENT vpp-dev + COMPONENT ${PLUGIN_DEV_COMPONENT} ) endforeach() add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_includes}) -- cgit 1.2.3-korg