cpputest: fix cmake 4.0 compatibility

In certain environments (such as Yocto), the project is built using the
latest version of CMake. CMake v4.0 has dropped support for versions
earlier than v3.5, and CppUTest fails to build.
This change introduces a patch that updates the minimum required CMake
version in CppUTest.

In addition, update the component to use git am instead of apply.

Signed-off-by: Gyorgy Szing <gyorgy.szing@arm.com>
Change-Id: I68291f4573fee3c64dd19c348bd8a30aa99b0c35
diff --git a/external/CppUTest/CppUTest.cmake b/external/CppUTest/CppUTest.cmake
index 7b916d5..f323ad8 100644
--- a/external/CppUTest/CppUTest.cmake
+++ b/external/CppUTest/CppUTest.cmake
@@ -16,8 +16,12 @@
 	GIT_REPOSITORY ${CPPUTEST_URL}
 	GIT_TAG ${CPPUTEST_REFSPEC}
 	GIT_SHALLOW FALSE
-	PATCH_COMMAND git stash
-	COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/cpputest-cmake-fix.patch
+	PATCH_COMMAND
+		git stash
+		COMMAND git branch -f bf-am
+		COMMAND git am ${CMAKE_CURRENT_LIST_DIR}/0001-cpputest-cmake-fix.patch
+		COMMAND git am ${CMAKE_CURRENT_LIST_DIR}/0002-Fix-cmake-4.0-compatibility.patch
+		COMMAND git reset bf-am
 	)
 
 include(${TS_ROOT}/tools/cmake/common/LazyFetch.cmake REQUIRED)