Fix: TFM_PLATFORM short input multi results

When building TFM with "-DTFM_PLATFORM=bl5340", "bl5340" and
"bl5340_dvk_cpuapp" are searched and break the build. This patch is to
guarantee that the subdirectory path name equals the target in build
command.

Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: I8a647e649d13d1240e97b72f4f684ab12423e7de
diff --git a/config/tfm_platform.cmake b/config/tfm_platform.cmake
index b410b29..188d16f 100644
--- a/config/tfm_platform.cmake
+++ b/config/tfm_platform.cmake
@@ -16,7 +16,7 @@
     file(GLOB_RECURSE PLATFORM_PATHS ${TARGET_PATH} "preload.cmake")
 
     # Search the list with platform name and store the result in PLATFORM_PATHS
-    list(FILTER PLATFORM_PATHS INCLUDE REGEX "${TFM_PLATFORM}")
+    list(FILTER PLATFORM_PATHS INCLUDE REGEX "/${TFM_PLATFORM}/")
 
     # Get the length of list PLATFORM_PATHS
     list(LENGTH PLATFORM_PATHS _PLATFORM_NUM)