Build: Change CMAKE_BUILD_TYPE to ignore case

Force CMAKE_BUILD_TYPE to be lowercase. Change all local cmake tests
that check it to lowercase.

Change-Id: I7465c22a86dcc7e5ff1802b43d1af74de5ba8b43
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 88bf8b3..0c9c764 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -24,6 +24,9 @@
 #Configure the default build type
 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (i.e. Debug)")
 
+#Ignore case on the cmake build types
+string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+
 if(CORE_IPC)
 	if (TFM_LVL EQUAL 3)
 		message(FATAL_ERROR "ERROR: Invalid isolation level!")
@@ -364,7 +367,7 @@
 	set(ATTEST_INCLUDE_OPTIONAL_CLAIMS ON)
 endif()
 
-if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+if (CMAKE_BUILD_TYPE STREQUAL "debug")
 	set(ATTEST_INCLUDE_TEST_CODE_AND_KEY_ID ON)
 else()
 	set(ATTEST_INCLUDE_TEST_CODE_AND_KEY_ID OFF)
diff --git a/bl2/ext/mcuboot/MCUBootConfig.cmake b/bl2/ext/mcuboot/MCUBootConfig.cmake
index 97edcfa..02c68a3 100644
--- a/bl2/ext/mcuboot/MCUBootConfig.cmake
+++ b/bl2/ext/mcuboot/MCUBootConfig.cmake
@@ -29,7 +29,7 @@
 
 	set(MCUBOOT_LOG_LEVEL "LOG_LEVEL_INFO" CACHE STRING "Configure the level of logging in MCUBoot.")
 	set_property(CACHE MCUBOOT_LOG_LEVEL PROPERTY STRINGS "LOG_LEVEL_OFF;LOG_LEVEL_ERROR;LOG_LEVEL_WARNING;LOG_LEVEL_INFO;LOG_LEVEL_DEBUG")
-	if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+	if (NOT CMAKE_BUILD_TYPE STREQUAL "debug")
 		set(MCUBOOT_LOG_LEVEL "LOG_LEVEL_OFF")
 	endif()
 	validate_cache_value(MCUBOOT_LOG_LEVEL)