Build: Introduce TARGET_PLATFORM_PATH
The TARGET_PLATFORM_PATH refers to the root directory of
target platform to build, for example
"platform/ext/target/arm/mps2/an521".
With the TARGET_PLATFORM_PATH, lots of references to this path with long
paths can be avoided.
Change-Id: Iaa536cac8048de803fc4a002641e066563679722
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/config/tfm_platform.cmake b/config/tfm_platform.cmake
index 8cb730e..f72fe59 100644
--- a/config/tfm_platform.cmake
+++ b/config/tfm_platform.cmake
@@ -40,6 +40,8 @@
set(TFM_PLATFORM "${TFM_PLATFORM_RELATIVE_PATH}" CACHE STRING "Target platform set as an relative path." FORCE)
endif()
-if (NOT EXISTS ${TARGET_PATH}/${TFM_PLATFORM}/CMakeLists.txt)
+set(TARGET_PLATFORM_PATH ${TARGET_PATH}/${TFM_PLATFORM})
+
+if (NOT EXISTS ${TARGET_PLATFORM_PATH}/CMakeLists.txt)
Message(FATAL_ERROR "Unsupported TFM_PLATFORM ${TFM_PLATFORM}")
endif()