summaryrefslogtreecommitdiff
path: root/runtimes/contrib/tflite_classify/CMakeLists.txt
blob: c0bf62738fc55a246a899331f999451439e2356b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
if(NOT BUILD_TFLITE_CLASSIFY_APP)
  return()
endif(NOT BUILD_TFLITE_CLASSIFY_APP)

list(APPEND SOURCES "src/tflite_classify.cc")
list(APPEND SOURCES "src/ImageClassifier.cc")
list(APPEND SOURCES "src/InferenceInterface.cc")

## Required package
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS system filesystem)

# Without this line, this appliation couldn't search the opencv library that were already installed in ${ROOTFS_DIR}/usr/lib/arm-linux-gnueabihf directory
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${ROOTFS_DIR}/usr/lib/arm-linux-gnueabihf -Wl,--rpath=${ROOTFS_DIR}/lib/arm-linux-gnueabihf")

add_executable(tflite_classify ${SOURCES})
target_include_directories(tflite_classify PRIVATE src)
target_link_libraries(tflite_classify tensorflow-lite ${LIB_PTHREAD} dl nnfw_lib_tflite)
target_link_libraries(tflite_classify ${Boost_LIBRARIES})
target_link_libraries(tflite_classify ${OpenCV_LIBRARIES})

install(TARGETS tflite_classify DESTINATION bin)