aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Modules
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-03-14 16:03:00 +0100
committerMauro Sardara <msardara@cisco.com>2019-03-14 17:26:50 +0100
commita784dc0bd5d2858d48c1c3c034b0db8bc58cd3a6 (patch)
tree772eca10297cb1722e7d76d0b928658a633b65ce /cmake/Modules
parent998977b643a700b2be5a1b476c03f90f517e9ffa (diff)
[HICN-113] Fix packaging system.
Change-Id: I779bfffedac5c593de9789b79218475ec4698c01 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/Packager.cmake22
1 files changed, 21 insertions, 1 deletions
diff --git a/cmake/Modules/Packager.cmake b/cmake/Modules/Packager.cmake
index b19145025..b4849963d 100644
--- a/cmake/Modules/Packager.cmake
+++ b/cmake/Modules/Packager.cmake
@@ -19,7 +19,23 @@ set(CONTACT "hicn-dev@lists.fd.io" CACHE STRING "Contact")
set(PACKAGE_MAINTAINER "ICN Team" CACHE STRING "Maintainer")
set(PACKAGE_VENDOR "fd.io" CACHE STRING "Vendor")
-# macro(set)
+function(get_next_version VERSION NEXT_VERSION)
+ string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1;\\2" VER_NUMBERS ${VERSION})
+
+ # Increment version for getting next version value
+ list(GET VER_NUMBERS 0 major)
+ list(GET VER_NUMBERS 1 minor)
+
+ math(EXPR minor "${minor} + 3")
+
+ if (minor GREATER 12)
+ set(minor "1")
+ math(EXPR major "${major} + 1")
+ endif()
+
+ set(minor "0${minor}")
+ set(${NEXT_VERSION} "${major}.${minor}" PARENT_SCOPE)
+endfunction()
macro(make_packages)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
@@ -68,6 +84,8 @@ macro(make_packages)
set(rpm_ver "${tag}-${commit_num}-release")
endif()
+ get_next_version(${tag}, next_version)
+
get_cmake_property(components COMPONENTS)
if(OS_ID_LIKE MATCHES "debian")
@@ -92,6 +110,7 @@ macro(make_packages)
set(DEB_DEPS)
if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "")
string(REPLACE "stable_version" ${tag} DEB_DEPS ${${lc}_DEB_DEPENDENCIES})
+ string(REPLACE "next_version" ${next_version} DEB_DEPS ${DEB_DEPS})
endif()
set(CPACK_${type}_${uc}_PACKAGE_DEPENDS "${DEB_DEPS}")
@@ -120,6 +139,7 @@ macro(make_packages)
set(RPM_DEPS)
if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "")
string(REPLACE "stable_version" ${tag} RPM_DEPS ${${lc}_RPM_DEPENDENCIES})
+ string(REPLACE "next_version" ${next_version} RPM_DEPS ${RPM_DEPS})
endif()
set(CPACK_${type}_${uc}_PACKAGE_REQUIRES "${RPM_DEPS}")