Set project version in one place only 76/234776/9
authorDariusz Michaluk <d.michaluk@samsung.com>
Thu, 28 May 2020 10:53:12 +0000 (12:53 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Mon, 6 Jul 2020 09:59:38 +0000 (11:59 +0200)
Change-Id: I4e39f86e922f650c611ce41683dc6e16f77dc83b

CMakeLists.txt
dcm-client/CMakeLists.txt
packaging/device-certificate-manager.spec
pkgconfig/device-certificate-manager-backend.pc.in
pkgconfig/device-certificate-manager.pc.in

index 3ea539c..4c7e341 100644 (file)
 # @author      Dariusz Michaluk <d.michaluk@samsung.com>
 # @author      Jaroslaw Pelczar <j.pelczar@samsung.com>
 
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
-##### Configure project version when using
-##### outdated tools like CMake v2
-
-IF(POLICY CMP0048)
-       CMAKE_POLICY(SET CMP0048 NEW)
-ENDIF()
-
-IF(CMAKE_VERSION VERSION_LESS 3.0)
-       PROJECT(device-certificate-manager CXX C)
-       SET(PROJECT_VERSION     "2.0")
-ELSE()
-       PROJECT(device-certificate-manager VERSION 2.0 LANGUAGES C CXX)
-ENDIF()
+CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
+PROJECT(device-certificate-manager VERSION 2.0 LANGUAGES C CXX)
 
 INCLUDE(GNUInstallDirs)
 INCLUDE(FindPkgConfig)
index 4ce16ac..ac78ed7 100644 (file)
@@ -52,7 +52,7 @@ TARGET_LINK_LIBRARIES(${TARGET_CLIENT}
 SET_PROPERTY(TARGET ${TARGET_CLIENT} APPEND PROPERTY LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/version_script.lds")
 SET_TARGET_PROPERTIES(${TARGET_CLIENT}
        PROPERTIES
-       VERSION 2.0
+       VERSION ${PROJECT_VERSION}
        DEFINE_SYMBOL DEVICE_CERTIFICATE_MANAGER_EXPORT
        VISIBILITY_INLINES_HIDDEN TRUE
        C_VISIBILITY_PRESET hidden
index b8791da..60d355f 100644 (file)
@@ -58,8 +58,7 @@ Internal tests for Device Certificate Manager
 cp -a %{SOURCE1001} .
 
 %build
-%cmake . -DVERSION=%{version} \
-       -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:Release} \
+%cmake . -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:Release} \
        -DSYSTEMD_UNIT_DIR=%{_unitdir} \
        -DUSER_NAME=%{user_name} \
        -DGROUP_NAME=%{group_name} \
index b622daf..510957f 100644 (file)
@@ -5,6 +5,6 @@ includedir=${prefix}/include
 
 Name: device-certificate-manager-backend
 Description: Device Certificate Manager Backend Package
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Requires: iotivity
 Cflags: -I${includedir}/device-certificate-manager-backend
index 31a8120..b016585 100644 (file)
@@ -5,6 +5,6 @@ includedir=${prefix}/include
 
 Name: device-certificate-manager
 Description: Device Certificate Manager Package
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Libs: -L${libdir} -ldevice-certificate-manager
 Cflags: -I${includedir}/device-certificate-manager