diff options
Diffstat (limited to 'hicn-plugin')
-rwxr-xr-x | hicn-plugin/CMakeLists.txt | 32 | ||||
-rw-r--r-- | hicn-plugin/cmake/Modules/Packaging.cmake | 31 |
2 files changed, 56 insertions, 7 deletions
diff --git a/hicn-plugin/CMakeLists.txt b/hicn-plugin/CMakeLists.txt index f58ecb061..aaa4136ff 100755 --- a/hicn-plugin/CMakeLists.txt +++ b/hicn-plugin/CMakeLists.txt @@ -13,7 +13,12 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR) project(hicn-plugin) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake/Modules/") + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules/" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" +) + set (CMAKE_CXX_STANDARD 11) set (CMAKE_C_STANDARD 11) @@ -24,6 +29,12 @@ if ( HAVE_MEMFD_CREATE ) add_definitions ( -DHAVE_MEMFD_CREATE ) endif() +if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + set(HICN_PLUGIN hicn-plugin) +endif() + +include (Packaging) + # Dependencies find_package(Vpp REQUIRED) @@ -222,14 +233,21 @@ set_target_properties(hicn_api_test_plugin LINKER_LANGUAGE C PREFIX "") -install(DIRECTORY DESTINATION ${VPP_INSTALL_PLUGIN}) +install(DIRECTORY + DESTINATION ${VPP_INSTALL_PLUGIN} + COMPONENT ${HICN_PLUGIN}) install(TARGETS hicn_plugin DESTINATION - ${VPP_INSTALL_PLUGIN}) + ${VPP_INSTALL_PLUGIN} + COMPONENT ${HICN_PLUGIN}) -install(DIRECTORY DESTINATION ${VPP_INSTALL_API_TEST_PLUGIN}) +install(DIRECTORY + DESTINATION ${VPP_INSTALL_API_TEST_PLUGIN} + COMPONENT ${HICN_PLUGIN}) install(TARGETS hicn_api_test_plugin - DESTINATION - ${VPP_INSTALL_API_TEST_PLUGIN}) + DESTINATION ${VPP_INSTALL_API_TEST_PLUGIN} + COMPONENT ${HICN_PLUGIN}) -install(FILES ${HICN_API_TEST_HEADER_FILES} ${HICN_API_GENERATED_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vpp_plugins/hicn) +install(FILES ${HICN_API_TEST_HEADER_FILES} ${HICN_API_GENERATED_FILES} + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vpp_plugins/hicn + COMPONENT ${HICN_PLUGIN})
\ No newline at end of file diff --git a/hicn-plugin/cmake/Modules/Packaging.cmake b/hicn-plugin/cmake/Modules/Packaging.cmake new file mode 100644 index 000000000..21ba4138d --- /dev/null +++ b/hicn-plugin/cmake/Modules/Packaging.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017-2019 Cisco and/or its affiliates. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +###################### +# Packages section +###################### + +set(${HICN_PLUGIN}_DESCRIPTION + "A high-performance Hybrid ICN forwarder as a plugin to VPP." + CACHE STRING "Description for deb/rpm package." +) + +set(${HICN_PLUGIN}_DEB_DEPENDENCIES + "libhicn (>= 1.0), vpp (== 19.01-release), vpp-plugins (== 19.01-release)" + CACHE STRING "Dependencies for deb/rpm package." +) + +set(${HICN_PLUGIN}_RPM_DEPENDENCIES + "libhicn >= 1.0, vpp = 19.01-release, vpp-plugins = 19.01-release" + CACHE STRING "Dependencies for deb/rpm package." +)
\ No newline at end of file |