aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
parentec2a9bbb89a4ec1ebf8982f1d611179cd84315b8 (diff)
cmake: a bit of packaging work
Change-Id: I40332c2348c4aab873d726532f2ac3c4abde7ec9 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/cmake/library.cmake23
-rw-r--r--src/cmake/pack.cmake (renamed from src/cmake/deb.cmake)16
-rw-r--r--src/cmake/plugin.cmake31
-rw-r--r--src/plugins/dpdk/CMakeLists.txt3
-rw-r--r--src/vpp-api/python/CMakeLists.txt1
-rw-r--r--src/vppinfra/CMakeLists.txt3
7 files changed, 59 insertions, 20 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 585f8a1502c..3d934f26459 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -61,7 +61,6 @@ include(cmake/api.cmake)
include(cmake/library.cmake)
include(cmake/exec.cmake)
include(cmake/plugin.cmake)
-include(cmake/deb.cmake)
##############################################################################
# subdirs - order matters
@@ -74,3 +73,4 @@ foreach(
add_subdirectory(${DIR})
endforeach()
+include(cmake/pack.cmake)
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake
index 66b4dffe575..0d1e97cb6a3 100644
--- a/src/cmake/library.cmake
+++ b/src/cmake/library.cmake
@@ -14,7 +14,7 @@
macro(add_vpp_library lib)
cmake_parse_arguments(ARG
""
- ""
+ "COMPONENT"
"SOURCES;MULTIARCH_SOURCES;API_FILES;LINK_LIBRARIES;INSTALL_HEADERS;DEPENDS"
${ARGN}
)
@@ -27,7 +27,14 @@ macro(add_vpp_library lib)
target_link_libraries(${lib} ${ARG_LINK_LIBRARIES})
endif()
# install .so
- install(TARGETS ${lib} DESTINATION ${VPP_LIB_DIR_NAME})
+ if(NOT ARG_COMPONENT)
+ set(ARG_COMPONENT vpp)
+ endif()
+ install(
+ TARGETS ${lib}
+ DESTINATION ${VPP_LIB_DIR_NAME}
+ COMPONENT ${ARG_COMPONENT}
+ )
if(ARG_MULTIARCH_SOURCES)
vpp_library_set_multiarch_sources(${lib} ${ARG_MULTIARCH_SOURCES})
@@ -37,7 +44,11 @@ macro(add_vpp_library lib)
vpp_add_api_files(${lib} ${ARG_API_FILES})
foreach(file ${ARG_API_FILES})
get_filename_component(dir ${file} DIRECTORY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.h DESTINATION include/${lib}/${dir})
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${file}.h
+ DESTINATION include/${lib}/${dir}
+ COMPONENT vpp-dev
+ )
endforeach()
endif()
@@ -49,7 +60,11 @@ macro(add_vpp_library lib)
if(ARG_INSTALL_HEADERS)
foreach(file ${ARG_INSTALL_HEADERS})
get_filename_component(dir ${file} DIRECTORY)
- install(FILES ${file} DESTINATION include/${lib}/${dir})
+ install(
+ FILES ${file}
+ DESTINATION include/${lib}/${dir}
+ COMPONENT vpp-dev
+ )
endforeach()
endif()
endmacro()
diff --git a/src/cmake/deb.cmake b/src/cmake/pack.cmake
index 09c8ac6e0b2..328896610d0 100644
--- a/src/cmake/deb.cmake
+++ b/src/cmake/pack.cmake
@@ -18,13 +18,15 @@ set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "VPP Team")
set(CPACK_PACKAGE_NAME "vpp")
set(CPACK_PACKAGE_VENDOR "fd.io")
-set(CPACK_PACKAGE_VERSION "18.08")
+set(CPACK_PACKAGE_VERSION "18.10")
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
-set(CPACK_DEBIAN_VPP_PACKAGE_NAME "vpp")
-set(CPACK_DEBIAN_VPP_FILE_NAME "vpp.deb")
-set(CPACK_DEBIAN_DEV_PACKAGE_NAME "vpp-dev")
-set(CPACK_DEBIAN_DEV_FILE_NAME "vpp-dev.deb")
-set(CPACK_DEBIAN_PLUGINS_PACKAGE_NAME "vpp-plugins")
-set(CPACK_DEBIAN_PLUGINS_FILE_NAME "vpp-plugins.deb")
+
+get_cmake_property(components COMPONENTS)
+foreach(lc ${components})
+ string(TOUPPER ${lc} uc)
+ set(CPACK_DEBIAN_${uc}_PACKAGE_NAME "${lc}")
+ set(CPACK_DEBIAN_${uc}_FILE_NAME "${lc}.deb")
+endforeach()
+
include(CPack)
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()
diff --git a/src/plugins/dpdk/CMakeLists.txt b/src/plugins/dpdk/CMakeLists.txt
index 72b85c147f3..09ebd11dd8b 100644
--- a/src/plugins/dpdk/CMakeLists.txt
+++ b/src/plugins/dpdk/CMakeLists.txt
@@ -129,6 +129,9 @@ if(DPDK_INCLUDE_DIR AND DPDK_LIB)
LINK_FLAGS
${DPDK_LINK_FLAGS}
+
+ COMPONENT
+ vpp-plugin-dpdk
)
else()
message(WARNING "DPDK not found - dpdk disabled")
diff --git a/src/vpp-api/python/CMakeLists.txt b/src/vpp-api/python/CMakeLists.txt
index 1b6aefa309d..52215ccafec 100644
--- a/src/vpp-api/python/CMakeLists.txt
+++ b/src/vpp-api/python/CMakeLists.txt
@@ -28,5 +28,6 @@ if(PYTHONINTERP_FOUND)
--dist-dir=${CMAKE_INSTALL_PREFIX}
OUTPUT_QUIET
)"
+ COMPONENT vpp-api-python
)
endif()
diff --git a/src/vppinfra/CMakeLists.txt b/src/vppinfra/CMakeLists.txt
index f358339db58..1b2797a85fc 100644
--- a/src/vppinfra/CMakeLists.txt
+++ b/src/vppinfra/CMakeLists.txt
@@ -32,7 +32,7 @@ configure_file(
install(
FILES ${CMAKE_BINARY_DIR}/vppinfra/config.h
DESTINATION include/vppinfra
- COMPONENT dev
+ COMPONENT vpp-dev
)
##############################################################################
@@ -198,6 +198,7 @@ add_vpp_library(vppinfra
SOURCES ${VPPINFRA_SRCS}
LINK_LIBRARIES m
INSTALL_HEADERS ${VPPINFRA_HEADERS}
+ COMPONENT libvppinfra
)
##############################################################################