Build: Introduce CONFIG_TFM_BOOT_STORE_MEASUREMENTS

Use the CONFIG_TFM_BOOT_STORE_MEASUREMENTS CMake variable instead of
MCUBOOT_MEASURED_BOOT to control measured boot mechanisms in
each boot stages.
The form (encoding) and amount of the saved measured boot data
can vary depending on the number of boot stages. This variable
can be used the serve the different cases.

Change-Id: I1cdb7372d753228f4b422e12c3f0f90594a2739e
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/bl2/ext/mcuboot/CMakeLists.txt b/bl2/ext/mcuboot/CMakeLists.txt
index 0ffdfe0..e3d3315 100644
--- a/bl2/ext/mcuboot/CMakeLists.txt
+++ b/bl2/ext/mcuboot/CMakeLists.txt
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -12,6 +12,10 @@
 
 set(MCUBOOT_KEY_ENC "${MCUBOOT_PATH}/enc-rsa2048-pub.pem" CACHE FILEPATH "Path to key with which to encrypt binary")
 
+if (CONFIG_TFM_BOOT_STORE_MEASUREMENTS)
+    set(MCUBOOT_MEASURED_BOOT ON)
+endif()
+
 add_subdirectory("${MCUBOOT_PATH}/boot/bootutil" bootutil)
 
 target_include_directories(bootutil