Kshitij Sisodia | eb9dfa7 | 2022-05-09 11:35:24 +0100 | [diff] [blame] | 1 | #---------------------------------------------------------------------------- |
Richard Burton | f32a86a | 2022-11-15 11:46:11 +0000 | [diff] [blame] | 2 | # SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its affiliates <open-source-office@arm.com> |
Kshitij Sisodia | eb9dfa7 | 2022-05-09 11:35:24 +0100 | [diff] [blame] | 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 Sisodia | 9c6f9f8 | 2022-05-20 14:30:02 +0100 | [diff] [blame] | 25 | cmake_minimum_required(VERSION 3.21.0) |
Kshitij Sisodia | eb9dfa7 | 2022-05-09 11:35:24 +0100 | [diff] [blame] | 26 | |
| 27 | project(ml-embedded-eval-kit-api |
| 28 | DESCRIPTION "Platform agnostic API for all examples.") |
| 29 | |
| 30 | set(SOURCE_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../source) |
| 31 | |
| 32 | set(LOGGING_PROJECT_DIR ${SOURCE_ROOT}/log) |
| 33 | set(ARM_MATH_PROJECT_DIR ${SOURCE_ROOT}/math) |
| 34 | set(API_COMMON_PROJECT_DIR ${SOURCE_ROOT}/application/api/common) |
| 35 | set(API_UC_PROJECT_DIR ${SOURCE_ROOT}/application/api/use_case) |
| 36 | |
| 37 | # Add dependencies first: |
| 38 | if (NOT TARGET arm_math) |
| 39 | add_subdirectory(${ARM_MATH_PROJECT_DIR} ${CMAKE_BINARY_DIR}/math) |
| 40 | endif() |
| 41 | |
| 42 | if (NOT TARGET log) |
| 43 | add_subdirectory(${LOGGING_PROJECT_DIR} ${CMAKE_BINARY_DIR}/log) |
| 44 | endif() |
| 45 | |
| 46 | # Add common part and the APIs: |
| 47 | add_subdirectory(${API_COMMON_PROJECT_DIR} ${CMAKE_BINARY_DIR}/common) |
| 48 | |
| 49 | file(GLOB UC_API_LIST "${API_UC_PROJECT_DIR}/*") |
Conor Kennedy | 6d1e521 | 2022-09-01 14:39:37 +0100 | [diff] [blame] | 50 | list(FILTER UC_API_LIST EXCLUDE REGEX ".md") # Remove .md files from UC_API_LIST |
Kshitij Sisodia | eb9dfa7 | 2022-05-09 11:35:24 +0100 | [diff] [blame] | 51 | |
| 52 | foreach(API ${UC_API_LIST}) |
| 53 | add_subdirectory(${API} ${CMAKE_BINARY_DIR}/${API}) |
| 54 | endforeach() |
Kshitij Sisodia | 937052d | 2022-05-13 16:44:16 +0100 | [diff] [blame] | 55 | |
| 56 | # Any custom steps that are required for the CMSIS pack generation flow |
| 57 | # must be declared here: |
| 58 | if (CMSIS_PACK_GEN_FLOW) |
Richard Burton | b76b855 | 2022-05-16 14:32:22 +0100 | [diff] [blame] | 59 | target_include_directories(common_api PUBLIC ${TENSORFLOW_SRC_PATH}) |
Kshitij Sisodia | 937052d | 2022-05-13 16:44:16 +0100 | [diff] [blame] | 60 | # 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) |
| 64 | endif() |