Change CMSIS Device file paths for CMSIS 6
This patch adds support for building with CMSIS_6 in addition to
CMSIS_5. A cmake flag(CMSIS_VER) with default value of 5 has been added.
This can be overridden in the cmake command line. CMSIS Device
component is no longer part of CMSIS_6 and is part of Cortex_DFP repo.
This patch also has the file path changes required to include CMSIS
Device from Cortex_DFP.
Change-Id: I148ab6b384d725ca83e75ac08e15c58809f25ac1
Signed-off-by: Rajasekaran Kalidoss <rajasekaran.kalidoss@arm.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c13c954..75ffc97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,5 @@
#
-# SPDX-FileCopyrightText: Copyright 2019-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
-#
+# SPDX-FileCopyrightText: Copyright 2019-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the License); you may
@@ -26,8 +25,16 @@
# Define build options
#
+SET(CMSIS_VER "5" CACHE STRING "CMSIS Version")
+
# Setup paths
-set(CMSIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmsis" CACHE PATH "Path to CMSIS.")
+if (${CMSIS_VER} EQUAL 5)
+ set(CMSIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmsis" CACHE PATH "Path to CMSIS.")
+elseif(${CMSIS_VER} EQUAL 6)
+ set(CMSIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmsis_6" CACHE PATH "Path to CMSIS.")
+else()
+ message(FATAL_ERROR "CMSIS_VER '${CMSIS_VER}' not supported. Should be 5 or 6.")
+endif()
set(CMSIS_NN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmsis-nn" CACHE PATH "Path to CMSIS-NN.")
set(CMSIS_VIEW_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmsis-view" CACHE PATH "Path to cmsis-view.")
set(CORE_DRIVER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/core_driver" CACHE PATH "Path to core driver.")