aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-11-06 12:42:46 +0100
committerMauro Sardara <msardara@cisco.com>2020-11-06 17:15:30 +0100
commit7f2bbf5f6934be58c016f0159e497fa519d14372 (patch)
tree0d6469b1a4089756dba08b8a76d109dd120095fe /cmake
parentda2c11cfd77383f37dd01e67efb5c44dece9c3a9 (diff)
[HICN-653] Cleanup build scripts.
Main changes: - Next VPP version is now counted 4 months (instead of 3) from the current one - CMake will now use Ninja as generator - Build functions are gathered under build/functions.sh and they are shared instead of being duplicated in build-extras and build-packages - Various bug fixes for dependencies and versioning. Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I3f482d2c87847a465019dd0992ee9375c88bb412 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/Packager.cmake17
1 files changed, 12 insertions, 5 deletions
diff --git a/cmake/Modules/Packager.cmake b/cmake/Modules/Packager.cmake
index 94b0e96a7..a943d1905 100644
--- a/cmake/Modules/Packager.cmake
+++ b/cmake/Modules/Packager.cmake
@@ -26,10 +26,10 @@ function(get_next_version VERSION NEXT_VERSION)
list(GET VER_NUMBERS 0 major)
list(GET VER_NUMBERS 1 minor)
- math(EXPR minor "${minor} + 3")
+ math(EXPR minor "${minor} + 4")
if (minor GREATER 12)
- set(minor "1")
+ math(EXPR minor "${minor} % 12")
math(EXPR major "${major} + 1")
endif()
@@ -63,7 +63,7 @@ macro(extract_version)
list(GET VER 4 COMMIT_NAME)
endmacro(extract_version)
-macro(make_packages)
+function(make_packages)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
# parse /etc/os-release
file(READ "/etc/os-release" os_version)
@@ -108,11 +108,18 @@ macro(make_packages)
message(STATUS "Version: ${deb_ver}")
get_next_version(${tag} next_version)
+ message(STATUS "Next version: ${next_version}")
get_cmake_property(components COMPONENTS)
list(REMOVE_ITEM components "Unspecified")
set(CPACK_COMPONENTS_ALL ${components})
+ list(LENGTH components N_COMPONENTS)
+
+ if (NOT N_COMPONENTS)
+ return()
+ endif()
+
if(OS_ID MATCHES "debian" OR OS_ID_LIKE MATCHES "debian")
set(CPACK_GENERATOR "DEB")
set(type "DEBIAN")
@@ -166,7 +173,7 @@ macro(make_packages)
set(CPACK_${type}_${uc}_DESCRIPTION "${${lc}_DESCRIPTION}")
set(RPM_DEPS)
- if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "")
+ if (NOT ${${lc}_RPM_DEPENDENCIES} STREQUAL "")
string(REPLACE "stable_version" ${tag} RPM_DEPS ${${lc}_RPM_DEPENDENCIES})
string(REPLACE "next_version" ${next_version} RPM_DEPS ${RPM_DEPS})
endif()
@@ -207,4 +214,4 @@ macro(make_packages)
include(CPack)
endif()
endif()
-endmacro()
+endfunction()