blob: 0e71bd136d6d0cd8c5fcea32f443feeb336d6846 [file] [log] [blame]
Kshitij Sisodiaeb9dfa72022-05-09 11:35:24 +01001#----------------------------------------------------------------------------
2# Copyright (c) 2022 Arm Limited. All rights reserved.
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#----------------------------------------------------------------------------
17
18#########################################################
19# This CMake project just consolidates all APIs to help #
20# generate CMSIS-pack from this repository. Projects #
21# that need to be included in the pack, should be added #
22# here along with their dependencies. #
23#########################################################
24
Kshitij Sisodia9c6f9f82022-05-20 14:30:02 +010025cmake_minimum_required(VERSION 3.21.0)
Kshitij Sisodiaeb9dfa72022-05-09 11:35:24 +010026
27project(ml-embedded-eval-kit-api
28 DESCRIPTION "Platform agnostic API for all examples.")
29
30set(SOURCE_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../source)
31
32set(LOGGING_PROJECT_DIR ${SOURCE_ROOT}/log)
33set(ARM_MATH_PROJECT_DIR ${SOURCE_ROOT}/math)
34set(API_COMMON_PROJECT_DIR ${SOURCE_ROOT}/application/api/common)
35set(API_UC_PROJECT_DIR ${SOURCE_ROOT}/application/api/use_case)
36
37# Add dependencies first:
38if (NOT TARGET arm_math)
39 add_subdirectory(${ARM_MATH_PROJECT_DIR} ${CMAKE_BINARY_DIR}/math)
40endif()
41
42if (NOT TARGET log)
43 add_subdirectory(${LOGGING_PROJECT_DIR} ${CMAKE_BINARY_DIR}/log)
44endif()
45
46# Add common part and the APIs:
47add_subdirectory(${API_COMMON_PROJECT_DIR} ${CMAKE_BINARY_DIR}/common)
48
49file(GLOB UC_API_LIST "${API_UC_PROJECT_DIR}/*")
Conor Kennedy6d1e5212022-09-01 14:39:37 +010050list(FILTER UC_API_LIST EXCLUDE REGEX ".md") # Remove .md files from UC_API_LIST
Kshitij Sisodiaeb9dfa72022-05-09 11:35:24 +010051
52foreach(API ${UC_API_LIST})
53 add_subdirectory(${API} ${CMAKE_BINARY_DIR}/${API})
54endforeach()
Kshitij Sisodia937052d2022-05-13 16:44:16 +010055
56# Any custom steps that are required for the CMSIS pack generation flow
57# must be declared here:
58if (CMSIS_PACK_GEN_FLOW)
Richard Burtonb76b8552022-05-16 14:32:22 +010059 target_include_directories(common_api PUBLIC ${TENSORFLOW_SRC_PATH})
Kshitij Sisodia937052d2022-05-13 16:44:16 +010060 # For CMSIS packs, we need CMSIS DSP definition.
61 # @TODO: Currently, this line is added multiple times to the include file. Uncomment when
62 # packgen is fixed.
63 # add_compile_definitions(arm_math PRIVATE ARM_MATH_DSP)
64endif()