Jim Flynn | fca233e | 2021-09-23 12:16:53 +0100 | [diff] [blame] | 1 | # |
| 2 | # Copyright © 2021 Arm Ltd and Contributors. All rights reserved. |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | |
| 6 | include(FindPackageHandleStandardArgs) |
| 7 | unset(TFLITE_SRC_FOUND) |
| 8 | |
| 9 | find_path(TfLite_INCLUDE_DIR |
| 10 | NAMES |
| 11 | tensorflow/lite |
| 12 | third_party |
| 13 | HINTS |
| 14 | ${TENSORFLOW_ROOT}) |
| 15 | |
| 16 | find_path(TfLite_Schema_INCLUDE_PATH |
| 17 | schema_generated.h |
| 18 | HINTS |
| 19 | ${TENSORFLOW_ROOT}/tensorflow/lite/schema) |
| 20 | |
| 21 | ## Set TFLITE_FOUND |
| 22 | find_package_handle_standard_args(TfLiteSrc DEFAULT_MSG TfLite_INCLUDE_DIR TfLite_Schema_INCLUDE_PATH) |
| 23 | |
| 24 | ## Set external variables for usage in CMakeLists.txt |
| 25 | if(TFLITE_SRC_FOUND) |
| 26 | set(TfLite_INCLUDE_DIR ${TfLite_INCLUDE_DIR}) |
| 27 | set(TfLite_Schema_INCLUDE_PATH ${TfLite_Schema_INCLUDE_PATH}) |
| 28 | endif() |