return()
endif(BUILD_TENSORFLOW_LITE)
-# TODO Allow users to import pre-built TensorFlow Lite!
-set(TensorFlowLite_FOUND FALSE)
+# Use pre-built TensorFlow Lite
+find_path(TFLITE_INCLUDE_DIR NAMES tensorflow/contrib/lite/interpreter.h)
+find_library(TFLITE_LIB NAMES tensorflow-lite)
+
+if(NOT TFLITE_INCLUDE_DIR)
+ set(TensorFlowLite_FOUND FALSE)
+ return()
+endif(NOT TFLITE_INCLUDE_DIR)
+
+if(NOT TFLITE_LIB)
+ set(TensorFlowLite_FOUND FALSE)
+ return()
+endif(NOT TFLITE_LIB)
+
+message(STATUS "Found TensorFlow Lite: TRUE (include: ${TFLITE_INCLUDE_DIR}, lib: ${TFLITE_LIB}")
+
+# TODO Use IMPORTED target
+add_library(tensorflow-lite INTERFACE)
+target_include_directories(tensorflow-lite SYSTEM INTERFACE ${TFLITE_INCLUDE_DIR})
+target_link_libraries(tensorflow-lite INTERFACE ${TFLITE_LIB})
+
+# Prefer -pthread to -lpthread
+set(THREADS_PREFER_PTHREAD_FLAG TRUE)
+set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+find_package(Threads QUIET)
+
+if(Threads_FOUND)
+ target_link_libraries(tensorflow-lite INTERFACE ${CMAKE_THREAD_LIBS_INIT})
+endif(Threads_FOUND)
+
+set(TensorFlowLite_FOUND TRUE)