aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-07 12:39:02 +0200
committerDamjan Marion <dmarion@me.com>2018-09-07 19:37:44 +0000
commit833de8cab672c806176d580a1ebc001f394b2eaf (patch)
tree6253c4198e789144ae36230f72c9455dc374fd16 /src/cmake
parent0745036cb9ead1a3aaf9686c8c8046cb7285ea52 (diff)
cmake: set packaging component for different files
Change-Id: I033a1f5cdb24f77462cb5ec90a62226d93f52925 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/api.cmake14
-rw-r--r--src/cmake/library.cmake6
-rw-r--r--src/cmake/plugin.cmake8
3 files changed, 18 insertions, 10 deletions
diff --git a/src/cmake/api.cmake b/src/cmake/api.cmake
index 533448ad16e..d799c54a0a6 100644
--- a/src/cmake/api.cmake
+++ b/src/cmake/api.cmake
@@ -26,7 +26,7 @@ function(vpp_generate_api_c_header file)
)
endfunction()
-function(vpp_generate_api_json_header file dir)
+function(vpp_generate_api_json_header file dir component)
set (output_name ${CMAKE_CURRENT_BINARY_DIR}/${file}.json)
get_filename_component(output_dir ${output_name} DIRECTORY)
add_custom_command (OUTPUT ${output_name}
@@ -36,7 +36,11 @@ function(vpp_generate_api_json_header file dir)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
COMMENT "Generating API header ${output_name}"
)
- install(FILES ${output_name} DESTINATION share/vpp/api/${dir}/)
+ install(
+ FILES ${output_name}
+ DESTINATION share/vpp/api/${dir}/
+ COMPONENT ${component}
+ )
endfunction()
##############################################################################
@@ -45,9 +49,9 @@ endfunction()
# @param dir - the install directory under ROOT/share/vpp/api to place the
# generated .json file
##############################################################################
-function(vpp_generate_api_header file dir)
+function(vpp_generate_api_header file dir component)
vpp_generate_api_c_header (${file})
- vpp_generate_api_json_header (${file} ${dir})
+ vpp_generate_api_json_header (${file} ${dir} ${component})
endfunction()
function(vpp_add_api_files name)
@@ -55,7 +59,7 @@ function(vpp_add_api_files name)
set(target ${name}_api_headers)
file(RELATIVE_PATH rpath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
foreach(file ${ARGN})
- vpp_generate_api_header (${file} core)
+ vpp_generate_api_header (${file} core vpp)
list(APPEND header_files ${file}.h ${file}.json)
set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${file})
endforeach()
diff --git a/src/cmake/library.cmake b/src/cmake/library.cmake
index cff5e3e3f2f..04165ffb1e4 100644
--- a/src/cmake/library.cmake
+++ b/src/cmake/library.cmake
@@ -76,6 +76,10 @@ endmacro()
function (add_vpp_headers path)
foreach(file ${ARGN})
get_filename_component(dir ${file} DIRECTORY)
- install(FILES ${file} DESTINATION include/${path}/${dir})
+ install(
+ FILES ${file}
+ DESTINATION include/${path}/${dir}
+ COMPONENT vpp-dev
+ )
endforeach()
endfunction()
diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake
index 9f9a6460f0f..c6f551dd3d5 100644
--- a/src/cmake/plugin.cmake
+++ b/src/cmake/plugin.cmake
@@ -20,10 +20,13 @@ macro(add_vpp_plugin name)
)
set(plugin_name ${name}_plugin)
set(api_headers)
+ if(NOT PLUGIN_COMPONENT)
+ set(PLUGIN_COMPONENT vpp-plugin-misc)
+ endif()
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)
+ vpp_generate_api_header(${f} plugins ${PLUGIN_COMPONENT})
list(APPEND api_headers ${f}.h ${f}.json)
set_property(GLOBAL APPEND PROPERTY VPP_API_FILES ${rpath}/${f})
install(
@@ -57,9 +60,6 @@ macro(add_vpp_plugin name)
)
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})