aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Modules
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-01-28 16:17:56 +0100
committerMauro Sardara <msardara@cisco.com>2019-01-28 17:01:42 +0100
commit317c2f8e695de186487347117296faa04ed42269 (patch)
treee7ad715c17bb0f606f2ffcbe85c2a3e4d07ead69 /cmake/Modules
parent015dd3fa693039acd08171e8a8d27b3776670a41 (diff)
[HICN-10] Fix for build number retrieval from CMake
Change-Id: I511df63962dda9ec53117a9a380cb5ac05a0b10b Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'cmake/Modules')
-rwxr-xr-xcmake/Modules/Packager.cmake12
1 files changed, 7 insertions, 5 deletions
diff --git a/cmake/Modules/Packager.cmake b/cmake/Modules/Packager.cmake
index 8f7ba4264..9a64488e4 100755
--- a/cmake/Modules/Packager.cmake
+++ b/cmake/Modules/Packager.cmake
@@ -51,19 +51,21 @@ macro(make_packages)
list(GET VER 1 commit_num)
list(GET VER 2 commit_name)
- if (NOT ENV{BUILD_NUMBER})
+ if ($ENV{BUILD_NUMBER} STREQUAL "")
set(bld "b1")
else()
set(bld "b$ENV{BUILD_NUMBER}")
endif()
+ message("Build number is: ${bld}")
+
#define DEB and RPM version numbers
if(${commit_num} EQUAL 0)
set(deb_ver "${tag}")
set(rpm_ver "${tag}")
else()
- set(deb_ver "${tag}-${commit_num}-${commit_name}~${bld}")
- set(rpm_ver "${tag}-${commit_num}_${commit_name}~${bld}")
+ set(deb_ver "${tag}-${commit_num}-release")
+ set(rpm_ver "${tag}-${commit_num}-release")
endif()
get_cmake_property(components COMPONENTS)
@@ -81,7 +83,7 @@ macro(make_packages)
set(CPACK_PACKAGE_VERSION "${deb_ver}")
foreach(lc ${components})
string(TOUPPER ${lc} uc)
- set(CPACK_${type}_${uc}_FILE_NAME "${lc}_${tag}-${commit_num}-release_${arch}.deb")
+ set(CPACK_${type}_${uc}_FILE_NAME "${lc}_${deb_ver}_${arch}.deb")
set(DEB_DEPS)
if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "")
@@ -121,7 +123,7 @@ macro(make_packages)
endif()
set(CPACK_RPM_${uc}_PACKAGE_NAME "${package_name}")
- set(CPACK_${type}_${uc}_FILE_NAME "${package_name}-${tag}-${commit_num}-release.${arch}.rpm")
+ set(CPACK_${type}_${uc}_FILE_NAME "${package_name}-${rpm_ver}.${arch}.rpm")
endforeach()
endif()