aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-01-22 00:02:05 +0100
committerMauro Sardara <msardara@cisco.com>2019-01-22 14:38:36 +0100
commit211b6a8bc6d959a874a43f28d4cda43eae48200d (patch)
treeba0385073c4c2f9baaf611a7f2c7a1e38d507edc /lib
parent7d710d62fcb2a15505a7a0fc8feb91b8342fafd6 (diff)
[HICN-3] First version of packaging system based on cmake.
Change-Id: I576f84f4c12f932e17e9169f2c6ffdaed128ca10 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/CMakeLists.txt4
-rw-r--r--lib/cmake/Modules/Packaging.cmake41
-rwxr-xr-xlib/src/CMakeLists.txt2
-rwxr-xr-xlib/src/base.h18
4 files changed, 54 insertions, 11 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 1be5e67f9..8b0280d7b 100755
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -30,6 +30,8 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(LIBHICN hicn)
endif()
+include (Packaging)
+
set(CMAKE_VERSION_MAJOR 0)
set(CMAKE_VERSION_MINOR 1)
set(CMAKE_VERSION_PATCH 1)
@@ -47,4 +49,4 @@ if (ANDROID_API)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -std=c99")
endif ()
-add_subdirectory (src)
+add_subdirectory (src) \ No newline at end of file
diff --git a/lib/cmake/Modules/Packaging.cmake b/lib/cmake/Modules/Packaging.cmake
new file mode 100644
index 000000000..5f946f95d
--- /dev/null
+++ b/lib/cmake/Modules/Packaging.cmake
@@ -0,0 +1,41 @@
+# 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(lib${LIBHICN}_DESCRIPTION
+"libhicn provides a support library coded in C \
+designed to help developers embed Hybrid ICN (hICN) \
+functionalities in their applications (eg. forwarder, \
+socket API, etc"
+ CACHE STRING "Description for deb/rpm package."
+)
+
+set(lib${LIBHICN}-dev_DESCRIPTION ${${LIBHICN}_DESCRIPTION}
+ CACHE STRING "Description for deb/rpm package."
+)
+set(lib${LIBHICN}-devel_DESCRIPTION ${${LIBHICN}_DESCRIPTION}
+ CACHE STRING "Description for deb/rpm package."
+)
+
+set(lib${LIBHICN}-dev_DEB_DEPENDENCIES
+ "libhicn (>= 1.0)"
+ CACHE STRING "Dependencies for deb/rpm package."
+)
+
+set(lib${LIBHICN}-devel_DEB_DEPENDENCIES
+ "libhicn >= 1.0"
+ CACHE STRING "Dependencies for deb/rpm package."
+)
diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt
index 0137a16c7..7cd4ccdaa 100755
--- a/lib/src/CMakeLists.txt
+++ b/lib/src/CMakeLists.txt
@@ -56,7 +56,7 @@ include(BuildMacros)
build_library(${LIBHICN}
SHARED STATIC
SOURCES ${LIBHICN_SOURCE_FILES}
- COMPONENT libhicn
+ COMPONENT lib${LIBHICN}
INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..
DEFINITIONS ${COMPILER_DEFINITIONS}
INSTALL_ROOT_DIR hicn
diff --git a/lib/src/base.h b/lib/src/base.h
index 2c082af89..0fcf2a9c2 100755
--- a/lib/src/base.h
+++ b/lib/src/base.h
@@ -94,15 +94,15 @@ HICN_TYPE(int x, int y, int z, int t)
}
#endif
-#define HICN_TYPE_IPV4_TCP HICN_TYPE(IPPROTO_IP, IPPROTO_TCP, IPPROTO_NONE, IPPROTO_NONE);
-#define HICN_TYPE_IPV4_ICMP HICN_TYPE(IPPROTO_IP, IPPROTO_ICMP, IPPROTO_NONE, IPPROTO_NONE);
-#define HICN_TYPE_IPV6_TCP HICN_TYPE(IPPROTO_IPV6, IPPROTO_TCP, IPPROTO_NONE, IPPROTO_NONE);
-#define HICN_TYPE_IPV6_ICMP HICN_TYPE(IPPROTO_IPV6, IPPROTO_ICMPV6, IPPROTO_NONE, IPPROTO_NONE);
-#define HICN_TYPE_IPV4_TCP_AH HICN_TYPE(IPPROTO_IP, IPPROTO_TCP, IPPROTO_NONE, IPPROTO_NONE);
-#define HICN_TYPE_IPV4_ICMP_AH HICN_TYPE(IPPROTO_IP, IPPROTO_ICMP, IPPROTO_NONE, IPPROTO_NONE);
-#define HICN_TYPE_IPV6_TCP_AH HICN_TYPE(IPPROTO_IPV6, IPPROTO_TCP, IPPROTO_AH, IPPROTO_NONE);
-#define HICN_TYPE_IPV6_ICMP_AH HICN_TYPE(IPPROTO_IPV6, IPPROTO_ICMPV6, IPPROTO_AH, IPPROTO_NONE);
-#define HICN_TYPE_NONE HICN_TYPE(IPPROTO_NONE, IPPROTO_NONE, IPPROTO_NONE, IPPROTO_NONE);
+#define HICN_TYPE_IPV4_TCP HICN_TYPE(IPPROTO_IP, IPPROTO_TCP, IPPROTO_NONE, IPPROTO_NONE)
+#define HICN_TYPE_IPV4_ICMP HICN_TYPE(IPPROTO_IP, IPPROTO_ICMP, IPPROTO_NONE, IPPROTO_NONE)
+#define HICN_TYPE_IPV6_TCP HICN_TYPE(IPPROTO_IPV6, IPPROTO_TCP, IPPROTO_NONE, IPPROTO_NONE)
+#define HICN_TYPE_IPV6_ICMP HICN_TYPE(IPPROTO_IPV6, IPPROTO_ICMPV6, IPPROTO_NONE, IPPROTO_NONE)
+#define HICN_TYPE_IPV4_TCP_AH HICN_TYPE(IPPROTO_IP, IPPROTO_TCP, IPPROTO_NONE, IPPROTO_NONE)
+#define HICN_TYPE_IPV4_ICMP_AH HICN_TYPE(IPPROTO_IP, IPPROTO_ICMP, IPPROTO_NONE, IPPROTO_NONE)
+#define HICN_TYPE_IPV6_TCP_AH HICN_TYPE(IPPROTO_IPV6, IPPROTO_TCP, IPPROTO_AH, IPPROTO_NONE)
+#define HICN_TYPE_IPV6_ICMP_AH HICN_TYPE(IPPROTO_IPV6, IPPROTO_ICMPV6, IPPROTO_AH, IPPROTO_NONE)
+#define HICN_TYPE_NONE HICN_TYPE(IPPROTO_NONE, IPPROTO_NONE, IPPROTO_NONE, IPPROTO_NONE)
/**
* @brief hICN Payload type