Add version number for libts

Read version number from file and apply to libts using the appropriate
CMake properties. The version number represents the API version of
libts and must be used according to the Semantic Versioning
specification (https://semver.org).

Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Change-Id: I09b12d71a95c874162be8ffee3b1b51a020725e4
diff --git a/deployments/libts/libts.cmake b/deployments/libts/libts.cmake
index d07e25c..6463ca1 100644
--- a/deployments/libts/libts.cmake
+++ b/deployments/libts/libts.cmake
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -12,6 +12,17 @@
 #-------------------------------------------------------------------------------
 
 #-------------------------------------------------------------------------------
+#  Common API version implemented by all libts deployments
+#-------------------------------------------------------------------------------
+version_semver_read(FILE "${CMAKE_CURRENT_LIST_DIR}/version.txt"
+					MAJOR _major MINOR _minor PATCH _patch)
+set_target_properties(ts PROPERTIES VERSION "${_major}.${_minor}.${_patch}")
+set_target_properties(ts PROPERTIES SOVERSION "${_major}")
+unset(_major)
+unset(_minor)
+unset(_patch)
+
+#-------------------------------------------------------------------------------
 #  Components that are common accross all deployments
 #
 #-------------------------------------------------------------------------------