Consolidate targets settings in opteesp deployments

In the "opteesp" environment UUID and SP name is communicated from cmake
to C sources using macro definitions. Refactor the cmake scripts to
remove duplication.

Change-Id: Ia51a334035a9120293b28ef8a46e66578c5d6c90
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
diff --git a/components/service/spm_test/spm_test.cmake b/components/service/spm_test/spm_test.cmake
index c35544e..d1e0553 100644
--- a/components/service/spm_test/spm_test.cmake
+++ b/components/service/spm_test/spm_test.cmake
@@ -13,14 +13,6 @@
 #-------------------------------------------------------------------------------
 target_include_directories(spm-test${SP_NUMBER} PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
 
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "spm-test${SP_NUMBER}"
-)
-set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
-set(TRACE_PREFIX "SPM-TEST${SP_NUMBER}" CACHE STRING "Trace prefix")
-
 #-------------------------------------------------------------------------------
 #  Extend with components that are common across all deployments of
 #  spm-test
diff --git a/deployments/attestation/config/default-opteesp/CMakeLists.txt b/deployments/attestation/config/default-opteesp/CMakeLists.txt
index 02c79eb..0fbc28f 100644
--- a/deployments/attestation/config/default-opteesp/CMakeLists.txt
+++ b/deployments/attestation/config/default-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -23,11 +23,6 @@
 set(SP_UUID_CANON "a1baf155-8876-4695-8f7c-54955e8db974")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "ATT" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "attestation"
-)
 
 target_include_directories(attestation PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/block-storage/config/cfi-flash-optee/CMakeLists.txt b/deployments/block-storage/config/cfi-flash-optee/CMakeLists.txt
index 28b0624..e85701e 100644
--- a/deployments/block-storage/config/cfi-flash-optee/CMakeLists.txt
+++ b/deployments/block-storage/config/cfi-flash-optee/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -28,11 +28,6 @@
 set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
 set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "block-storage"
-)
 
 target_include_directories(block-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/block-storage/config/default-opteesp/CMakeLists.txt b/deployments/block-storage/config/default-opteesp/CMakeLists.txt
index 657df4a..5ed976d 100644
--- a/deployments/block-storage/config/default-opteesp/CMakeLists.txt
+++ b/deployments/block-storage/config/default-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -21,11 +21,6 @@
 set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
 set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "block-storage"
-)
 
 target_include_directories(block-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/block-storage/config/edk2-secure-flash-opteesp/CMakeLists.txt b/deployments/block-storage/config/edk2-secure-flash-opteesp/CMakeLists.txt
index 76eec3a..44b6d3c 100644
--- a/deployments/block-storage/config/edk2-secure-flash-opteesp/CMakeLists.txt
+++ b/deployments/block-storage/config/edk2-secure-flash-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -32,11 +32,6 @@
 set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
 set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "block-storage"
-)
 
 target_include_directories(block-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/block-storage/config/semihosted-opteesp/CMakeLists.txt b/deployments/block-storage/config/semihosted-opteesp/CMakeLists.txt
index ed89203..898416f 100644
--- a/deployments/block-storage/config/semihosted-opteesp/CMakeLists.txt
+++ b/deployments/block-storage/config/semihosted-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -27,11 +27,6 @@
 set(SP_UUID_CANON "63646e80-eb52-462f-ac4f-8cdf3987519c")
 set(SP_HEAP_SIZE "120 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "BLOCK" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "block-storage"
-)
 
 target_include_directories(block-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/crypto/config/default-opteesp/CMakeLists.txt b/deployments/crypto/config/default-opteesp/CMakeLists.txt
index e62c23f..dba9c1c 100644
--- a/deployments/crypto/config/default-opteesp/CMakeLists.txt
+++ b/deployments/crypto/config/default-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -30,11 +30,6 @@
 set(SP_UUID_CANON "d9df52d5-16a2-4bb2-9aa4-d26d3b84e8c0")
 set(SP_HEAP_SIZE "490 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "CRYPTO" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "crypto"
-)
 
 target_include_directories(crypto PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/CMakeLists.txt b/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/CMakeLists.txt
index 19985b6..8e80a01 100644
--- a/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/CMakeLists.txt
+++ b/deployments/env-test/config/baremetal-fvp_base_revc-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -23,11 +23,6 @@
 set(SP_UUID_CANON "33c75baf-ac6a-4fe4-8ac7-e9909bee2d17")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "ENVTEST" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "env-test"
-)
 
 target_include_directories(env-test PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/env-test/config/n1sdp-opteesp/CMakeLists.txt b/deployments/env-test/config/n1sdp-opteesp/CMakeLists.txt
index 6540dd0..7000a08 100644
--- a/deployments/env-test/config/n1sdp-opteesp/CMakeLists.txt
+++ b/deployments/env-test/config/n1sdp-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -24,11 +24,6 @@
 set(SP_UUID_CANON "33c75baf-ac6a-4fe4-8ac7-e9909bee2d17")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "ENVTEST" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "env-test"
-)
 
 target_include_directories(env-test PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/fwu/config/default-opteesp/CMakeLists.txt b/deployments/fwu/config/default-opteesp/CMakeLists.txt
index 5503715..713eb4f 100644
--- a/deployments/fwu/config/default-opteesp/CMakeLists.txt
+++ b/deployments/fwu/config/default-opteesp/CMakeLists.txt
@@ -22,11 +22,6 @@
 target_include_directories(fwu PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
 set(SP_UUID_CANON "6823a838-1b06-470e-9774-0cce8bfb53fd")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "fwu"
-)
 
 target_include_directories(fwu PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/internal-trusted-storage/config/default-opteesp/CMakeLists.txt b/deployments/internal-trusted-storage/config/default-opteesp/CMakeLists.txt
index 21f4efb..ef31662 100644
--- a/deployments/internal-trusted-storage/config/default-opteesp/CMakeLists.txt
+++ b/deployments/internal-trusted-storage/config/default-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -20,11 +20,6 @@
 set(SP_UUID_CANON "dc1eef48-b17a-4ccf-ac8b-dfcff7711b14")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "ITS" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "internal-trusted-storage"
-)
 
 target_include_directories(internal-trusted-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/internal-trusted-storage/config/shared-flash-opteesp/CMakeLists.txt b/deployments/internal-trusted-storage/config/shared-flash-opteesp/CMakeLists.txt
index e05cb21..fab64ce 100644
--- a/deployments/internal-trusted-storage/config/shared-flash-opteesp/CMakeLists.txt
+++ b/deployments/internal-trusted-storage/config/shared-flash-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -20,11 +20,6 @@
 set(SP_UUID_CANON "dc1eef48-b17a-4ccf-ac8b-dfcff7711b14")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "ITS" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "internal-trusted-storage"
-)
 
 target_include_directories(internal-trusted-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/protected-storage/config/default-opteesp/CMakeLists.txt b/deployments/protected-storage/config/default-opteesp/CMakeLists.txt
index 690094f..00f13d4 100644
--- a/deployments/protected-storage/config/default-opteesp/CMakeLists.txt
+++ b/deployments/protected-storage/config/default-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -20,11 +20,6 @@
 set(SP_UUID_CANON "751bf801-3dde-4768-a514-0f10aeed1790")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "PS" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "protected-storage"
-)
 
 target_include_directories(protected-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/protected-storage/config/shared-flash-opteesp/CMakeLists.txt b/deployments/protected-storage/config/shared-flash-opteesp/CMakeLists.txt
index ad9bfe4..df58fa3 100644
--- a/deployments/protected-storage/config/shared-flash-opteesp/CMakeLists.txt
+++ b/deployments/protected-storage/config/shared-flash-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -20,11 +20,6 @@
 set(SP_UUID_CANON "751bf801-3dde-4768-a514-0f10aeed1790")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "PS" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "protected-storage"
-)
 
 target_include_directories(protected-storage PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/se-proxy/config/corstone1000-opteesp/CMakeLists.txt b/deployments/se-proxy/config/corstone1000-opteesp/CMakeLists.txt
index 4e8431f..6294abf 100644
--- a/deployments/se-proxy/config/corstone1000-opteesp/CMakeLists.txt
+++ b/deployments/se-proxy/config/corstone1000-opteesp/CMakeLists.txt
@@ -22,11 +22,6 @@
 set(SP_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "se-proxy"
-)
 
 target_include_directories(se-proxy PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/se-proxy/config/default-opteesp/CMakeLists.txt b/deployments/se-proxy/config/default-opteesp/CMakeLists.txt
index d90eeb6..d5d85d6 100644
--- a/deployments/se-proxy/config/default-opteesp/CMakeLists.txt
+++ b/deployments/se-proxy/config/default-opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -24,11 +24,6 @@
 set(SP_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "se-proxy"
-)
 
 target_include_directories(se-proxy PRIVATE
 	${CMAKE_CURRENT_LIST_DIR}
diff --git a/deployments/sfs-demo/opteesp/CMakeLists.txt b/deployments/sfs-demo/opteesp/CMakeLists.txt
index a1fa569..de886bb 100644
--- a/deployments/sfs-demo/opteesp/CMakeLists.txt
+++ b/deployments/sfs-demo/opteesp/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -19,11 +19,6 @@
 set(SP_UUID_CANON "01109cf8-e5ca-446f-9b55-f3cdc65110c8")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "SFSDEMO" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "sfs-demo"
-)
 
 add_components(TARGET "sfs-demo"
 	BASE_DIR ${TS_ROOT}
diff --git a/deployments/smm-gateway/config/default-opteesp/CMakeLists.txt b/deployments/smm-gateway/config/default-opteesp/CMakeLists.txt
index 06c0138..f9dffff 100644
--- a/deployments/smm-gateway/config/default-opteesp/CMakeLists.txt
+++ b/deployments/smm-gateway/config/default-opteesp/CMakeLists.txt
@@ -23,11 +23,6 @@
 set(SP_UUID_CANON "ed32d533-99e6-4209-9cc0-2d72cdd998a7")
 set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
 set(TRACE_PREFIX "SMMGW" CACHE STRING "Trace prefix")
-include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
-set_target_uuids(
-	SP_UUID ${SP_UUID_CANON}
-	SP_NAME "smm-gateway"
-)
 
 # Setting the MM communication buffer parameters
 set(MM_COMM_BUFFER_ADDRESS "0x00000008 0x81000000" CACHE STRING "Address of MM communicte buffer in 64 bit DTS format")
diff --git a/deployments/spm-test1/opteesp/CMakeLists.txt b/deployments/spm-test1/opteesp/CMakeLists.txt
index b21bcf9..1a16a98 100644
--- a/deployments/spm-test1/opteesp/CMakeLists.txt
+++ b/deployments/spm-test1/opteesp/CMakeLists.txt
@@ -15,7 +15,9 @@
 set(SP_BIN_UUID_CANON "5c9edbc3-7b3a-4367-9f83-7c191ae86a37")
 set(SP_UUID_CANON "5c9edbc3-7b3a-4367-9f83-7c191ae86a37")
 set(SP_NUMBER 1)
-include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
+set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "SPM-TEST${SP_NUMBER}" CACHE STRING "Trace prefix")
+
 #-------------------------------------------------------------------------------
 #  Components that are spm-test specific to deployment in the opteesp
 #  environment.
@@ -31,3 +33,4 @@
 		"environments/opteesp"
 )
 
+include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
diff --git a/deployments/spm-test2/opteesp/CMakeLists.txt b/deployments/spm-test2/opteesp/CMakeLists.txt
index 7942d50..3caa62b 100644
--- a/deployments/spm-test2/opteesp/CMakeLists.txt
+++ b/deployments/spm-test2/opteesp/CMakeLists.txt
@@ -15,7 +15,9 @@
 set(SP_BIN_UUID_CANON "7817164c-c40c-4d1a-867a-9bb2278cf41a")
 set(SP_UUID_CANON "7817164c-c40c-4d1a-867a-9bb2278cf41a")
 set(SP_NUMBER 2)
-include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
+set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "SPM-TEST${SP_NUMBER}" CACHE STRING "Trace prefix")
+
 #-------------------------------------------------------------------------------
 #  Components that are spm-test specific to deployment in the opteesp
 #  environment.
@@ -30,3 +32,5 @@
 		"components/messaging/ffa/libsp"
 		"environments/opteesp"
 )
+
+include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
diff --git a/deployments/spm-test3/opteesp/CMakeLists.txt b/deployments/spm-test3/opteesp/CMakeLists.txt
index d0e198c..87c1c1c 100644
--- a/deployments/spm-test3/opteesp/CMakeLists.txt
+++ b/deployments/spm-test3/opteesp/CMakeLists.txt
@@ -15,7 +15,9 @@
 set(SP_BIN_UUID_CANON "23eb0100-e32a-4497-9052-2f11e584afa6")
 set(SP_UUID_CANON "23eb0100-e32a-4497-9052-2f11e584afa6")
 set(SP_NUMBER 3)
-include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
+set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "SPM-TEST${SP_NUMBER}" CACHE STRING "Trace prefix")
+
 #-------------------------------------------------------------------------------
 #  Components that are spm-test specific to deployment in the opteesp
 #  environment.
@@ -30,3 +32,5 @@
 		"components/messaging/ffa/libsp"
 		"environments/opteesp"
 )
+
+include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
diff --git a/deployments/spm-test4/opteesp/CMakeLists.txt b/deployments/spm-test4/opteesp/CMakeLists.txt
index 7197aa7..c0cf298 100644
--- a/deployments/spm-test4/opteesp/CMakeLists.txt
+++ b/deployments/spm-test4/opteesp/CMakeLists.txt
@@ -15,7 +15,9 @@
 set(SP_BIN_UUID_CANON "423762ed-7772-406f-99d8-0c27da0abbf8")
 set(SP_UUID_CANON "23eb0100-e32a-4497-9052-2f11e584afa6")
 set(SP_NUMBER 4)
-include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
+set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
+set(TRACE_PREFIX "SPM-TEST${SP_NUMBER}" CACHE STRING "Trace prefix")
+
 #-------------------------------------------------------------------------------
 #  Components that are spm-test specific to deployment in the opteesp
 #  environment.
@@ -30,3 +32,5 @@
 		"components/messaging/ffa/libsp"
 		"environments/opteesp"
 )
+
+include(${TS_ROOT}/components/service/spm_test/spm_test.cmake)
diff --git a/environments/opteesp/component.cmake b/environments/opteesp/component.cmake
index f05b12a..56fc297 100644
--- a/environments/opteesp/component.cmake
+++ b/environments/opteesp/component.cmake
@@ -23,6 +23,17 @@
 if ("${_tgt_type}" STREQUAL "EXECUTABLE")
 	compiler_generate_stripped_elf(TARGET ${TGT} NAME "${SP_BIN_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
 	install(FILES ${STRIPPED_ELF} DESTINATION ${TS_ENV}/bin)
+
+	# Get the name of the SP.
+	get_target_property(_tgt_name ${TGT} NAME )
+	set(SP_NAME "${_tgt_name}" CACHE STRING "Name of the SP.")
+
+	include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
+	set_target_uuids(
+		SP_UUID ${SP_UUID_CANON}
+		SP_NAME ${SP_NAME}
+	)
+	set(SP_UUID_LE ${SP_UUID_LE} CACHE STRING "SP_FFA_UUID_CANON in litte endian binary format")
 endif()
 
 target_sources(${TGT} PRIVATE
diff --git a/tools/cmake/common/TargetCompileDefinitions.cmake b/tools/cmake/common/TargetCompileDefinitions.cmake
index 15d55ad..f401a40 100644
--- a/tools/cmake/common/TargetCompileDefinitions.cmake
+++ b/tools/cmake/common/TargetCompileDefinitions.cmake
@@ -74,6 +74,11 @@
 ``SP_NAME``
 The name of the SP.
 
+OUTPUTS:
+
+``SP_UUID_LE``
+SP_UUID converted to little-endian binary format.
+
 #]===]
 
 function (set_target_uuids)