From 9f30bf6e794a7b431217ce91038a4ec0f917dc08 Mon Sep 17 00:00:00 2001 From: Marco Trinelli Date: Tue, 23 Mar 2021 15:55:01 +0100 Subject: [HICN-688] Include packethicn in hicn build Add license headers Add dependencies Fix build for Ubuntu 18.04 Move doc Signed-off-by: Marco Trinelli Change-Id: Ie92268d2d3a47c47746107ac6f9c34b21949671c --- extras/packethicn/CMakeLists.txt | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 extras/packethicn/CMakeLists.txt (limited to 'extras/packethicn/CMakeLists.txt') diff --git a/extras/packethicn/CMakeLists.txt b/extras/packethicn/CMakeLists.txt new file mode 100644 index 000000000..cf5f7c26f --- /dev/null +++ b/extras/packethicn/CMakeLists.txt @@ -0,0 +1,86 @@ +# Copyright (c) 2021 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. + +cmake_minimum_required(VERSION 3.5) +cmake_policy(SET CMP0048 NEW) + +project(packethicn VERSION 0.0.1 DESCRIPTION "hICN protocol plugin" LANGUAGES C) + +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Modules" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" +) + +include(BuildMacros) +include(Packaging) + +set(PACKETHICN packethicn) + +find_package(Wireshark CONFIG REQUIRED) + +if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + find_package(Libhicn REQUIRED) +else() + if (DISABLE_SHARED_LIBRARIES) + if (WIN32) + set(HICN_LIBRARIES ${LIBHICN_STATIC}) + else () + set(HICN_LIBRARIES ${LIBHICN_STATIC} log) + endif () + list(APPEND DEPENDENCIES + ${LIBHICN_STATIC} + ) + else () + set(HICN_LIBRARIES ${LIBHICN_SHARED}) + list(APPEND DEPENDENCIES + ${LIBHICN_SHARED} + ) + endif () +endif() + +if(NOT Wireshark_PLUGINS_ENABLED) + message(FATAL_ERROR "Wireshark was compiled without support for plugins") +endif() + +set(CMAKE_C_VISIBILITY_PRESET hidden) +if (CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}") +endif() + +set(COMPILER_DEFINITIONS -DVERSION=\"${PROJECT_VERSION}\") + +set(SOURCE_FILES + packet-hicn.c +) + +list(APPEND PACKETHICN_INCLUDE_DIRS + ${HICN_INCLUDE_DIRS} +) + +list(APPEND LIBRARIES + ${HICN_LIBRARIES} + epan +) + +build_library(${PACKETHICN} + MODULE + SOURCES ${SOURCE_FILES} + LINK_LIBRARIES ${LIBRARIES} + DEPENDS ${DEPENDENCIES} + COMPONENT ${PACKETHICN} + INCLUDE_DIRS ${PACKETHICN_INCLUDE_DIRS} + INSTALL_FULL_PATH_DIR ${Wireshark_PLUGIN_INSTALL_DIR}/epan + DEFINITIONS ${COMPILER_DEFINITIONS} + EMPTY_PREFIX true +) \ No newline at end of file -- cgit 1.2.3-korg