Corstone700 Kernel modules build fix.

JIRA: MLBEDSW-5531
Change-Id: Ib4b6b6b0ee3995bb01029d561c4cf7eed981a303
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4711a19..e447afb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,15 @@
 option(BUILD_MAILBOX "Build the MHU mailbox kernel module" ON)
 option(BUILD_REMOTEPROC "Build the remoteproc kernel module" ON)
 
+# Set variables
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+    set(ARCH "arm64")
+else()
+    set(ARCH "arm")
+endif()
+
+string(REGEX REPLACE "(.*)gcc$" "\\1" CROSS_COMPILE "${CMAKE_C_COMPILER}")
+
 # Add rpath to library directory
 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
 
@@ -42,7 +51,7 @@
 endif()
 
 if (BUILD_REMOTEPROC)
-add_subdirectory(remoteproc)
+    add_subdirectory(remoteproc)
 endif()
 
 # Build flatbuffers