1 nnas_find_package(FlatBuffers QUIET)
3 if(NOT FlatBuffers_FOUND)
4 message(STATUS "Build mio-tflite: FAILED (missing Flatbuffers)")
6 endif(NOT FlatBuffers_FOUND)
8 nnas_find_package(TensorFlowSource EXACT 2.3.0 QUIET)
10 if(NOT TensorFlowSource_FOUND)
12 endif(NOT TensorFlowSource_FOUND)
14 message(STATUS "Build mio-tflite: TRUE")
16 set(SCHEMA_FILE "${TensorFlowSource_DIR}/tensorflow/lite/schema/schema.fbs")
18 # NOTE Use copy of schema.fbs as to provide unified way for circle also
19 add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/schema.fbs"
20 COMMAND ${CMAKE_COMMAND} -E copy "${SCHEMA_FILE}" schema.fbs
21 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
22 DEPENDS "${SCHEMA_FILE}"
25 FlatBuffers_Target(mio_tflite
26 OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/gen/mio/tflite"
27 INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/gen"
28 SCHEMA_DIR "${CMAKE_CURRENT_BINARY_DIR}"
29 SCHEMA_FILES "schema.fbs"
32 add_executable(mio_tflite_example example.cpp)
33 target_link_libraries(mio_tflite_example mio_tflite)
35 # Temporay tflite validation tool to replace nnkit-tflite
36 # TODO provide full tflite validation with runtime/interpreter
37 add_executable(mio_tflite_validate example.cpp)
38 target_link_libraries(mio_tflite_validate mio_tflite)