diff options
author | Suchang Woo <suchang.woo@samsung.com> | 2015-03-04 17:31:49 +0900 |
---|---|---|
committer | Suchang Woo <suchang.woo@samsung.com> | 2015-03-06 21:28:04 -0800 |
commit | 8e510cddd4f5c50c19fcd126fcc136662a05bacc (patch) | |
tree | d02ec5a87946d390aebd88b964418a3ce955f0db | |
parent | 0b921c6c1c2090803e2bbd16aa4dae739c7737f0 (diff) | |
download | bundle-8e510cddd4f5c50c19fcd126fcc136662a05bacc.tar.gz bundle-8e510cddd4f5c50c19fcd126fcc136662a05bacc.tar.bz2 bundle-8e510cddd4f5c50c19fcd126fcc136662a05bacc.zip |
Get version info from .spec filesubmit/tizen_wearable/20150313.022842submit/tizen_tv/20150313.022842submit/tizen_mobile/20150313.022842accepted/tizen/wearable/20150313.083853accepted/tizen/tv/20150313.083822accepted/tizen/mobile/20150313.083940
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: I828a8ddcbd1c1846098229caf9951892c62398ff
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | packaging/bundle.spec | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bbab736..42cb008 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,13 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(bundle C) -set (VERSION "0.1.31") + +IF("${VERSION}" STREQUAL "") + MESSAGE(FATAL_ERROR "VERSION is not defined") +ENDIF() +STRING(REGEX MATCH "^[0-9]+" VERSION_MAJOR ${VERSION}) +IF("${VERSION_MAJOR}" STREQUAL "") + MESSAGE(FATAL_ERROR "can't get VERSION_MAJOR") +ENDIF() ### Required packages INCLUDE(FindPkgConfig) @@ -21,7 +28,7 @@ add_library(bundle SHARED src/keyval.c src/keyval_array.c ) -set_target_properties(bundle PROPERTIES SOVERSION "0") +set_target_properties(bundle PROPERTIES SOVERSION ${VERSION_MAJOR}) set_target_properties(bundle PROPERTIES VERSION "${VERSION}") message(STATUS "Version from debian/changelog: ${VERSION}, Major version: ${VERSION_MAJOR}") target_link_libraries(bundle ${pkgs_LDFLAGS}) diff --git a/packaging/bundle.spec b/packaging/bundle.spec index a4c8270..a2a8431 100644 --- a/packaging/bundle.spec +++ b/packaging/bundle.spec @@ -27,7 +27,7 @@ Simple string key-val dictionary ADT (devel) cp %{SOURCE1001} . %build -%cmake . +%cmake -DVERSION=%{version} . %__make %{?_smp_mflags} %install |