Fix: libts-import.cmake calling cmake incorrectly

This change fixes two errors in the mentioned file:
  - the cmake configuration command depends on the binary directory
    existing when the call is made, because the working directory is
    used to set the location of the build directory.
    As a fix use the -B switch instead. This way cmake will create the
    directory when needed.
  - the result of the config step was not set to _exec_error variable
    and the code was checking this to detect errors. Thus error
    detection was not working.

Change-Id: I1e5db0b4b5453144b0cf2903d125a5a2010727fe
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
diff --git a/deployments/libts/libts-import.cmake b/deployments/libts/libts-import.cmake
index 792ba86..dcabc45 100644
--- a/deployments/libts/libts-import.cmake
+++ b/deployments/libts/libts-import.cmake
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -32,9 +32,9 @@
 	${CMAKE_COMMAND}
 		-DCMAKE_INSTALL_PREFIX=${LIBTS_INSTALL_PATH}
 		-GUnix\ Makefiles
-		${LIBTS_SOURCE_DIR}
-	WORKING_DIRECTORY
-		${LIBTS_BINARY_DIR}
+		-S ${LIBTS_SOURCE_DIR}
+		-B ${LIBTS_BINARY_DIR}
+	RESULT_VARIABLE _exec_error
 )
 
 if (_exec_error)