From 7f2bbf5f6934be58c016f0159e497fa519d14372 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 6 Nov 2020 12:42:46 +0100 Subject: [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 Change-Id: I3f482d2c87847a465019dd0992ee9375c88bb412 Signed-off-by: Mauro Sardara --- cmake/Modules/Packager.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'cmake/Modules/Packager.cmake') 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() -- cgit 1.2.3-korg