summaryrefslogtreecommitdiff
path: root/infra/nncc/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'infra/nncc/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake')
-rw-r--r--infra/nncc/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake62
1 files changed, 62 insertions, 0 deletions
diff --git a/infra/nncc/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake b/infra/nncc/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake
new file mode 100644
index 000000000..2f4ff0a46
--- /dev/null
+++ b/infra/nncc/cmake/packages/TensorFlowLite-1.12/TensorFlowLiteConfig.cmake
@@ -0,0 +1,62 @@
+function(_TensorFlowLite_import)
+ nncc_find_package(TensorFlowSource EXACT 1.12 QUIET)
+
+ if(NOT TensorFlowSource_FOUND)
+ set(TensorFlowLite_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT TensorFlowSource_FOUND)
+
+ # TensorFlow 1.12 downloads FlatBuffers from https://github.com/google/flatbuffers/archive/1f5eae5d6a1.tar.gz
+ #
+ # Let's use 1.10 released in 2018.10 (compatible with 1f5eae5d6a1).
+ nncc_find_package(FlatBuffersSource EXACT 1.10 QUIET)
+
+ if(NOT FlatBuffersSource_FOUND)
+ set(TensorFlowLite_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT FlatBuffersSource_FOUND)
+
+ nncc_find_package(Farmhash QUIET)
+
+ if(NOT Farmhash_FOUND)
+ set(TensorFlowLite_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT Farmhash_FOUND)
+
+ nncc_find_package(Eigen QUIET)
+
+ if(NOT Eigen_FOUND)
+ set(TensorFlowLite_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT Eigen_FOUND)
+
+ nncc_find_package(GEMMLowp QUIET)
+
+ if(NOT GEMMLowp_FOUND)
+ set(TensorFlowLite_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT GEMMLowp_FOUND)
+
+ nncc_find_package(NEON2SSE QUIET)
+
+ if(NOT NEON2SSE_FOUND)
+ set(TensorFlowLite_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT NEON2SSE_FOUND)
+
+ nncc_find_package(Abseil QUIET)
+
+ if(NOT Abseil_FOUND)
+ set(TensorFlowLite_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT Abseil_FOUND)
+
+ if(NOT TARGET tensorflowlite-1.12)
+ nncc_include(ExternalProjectTools)
+ add_extdirectory("${CMAKE_CURRENT_LIST_DIR}/Lite" tflite-1.12)
+ endif(NOT TARGET tensorflowlite-1.12)
+
+ set(TensorFlowLite_FOUND TRUE PARENT_SCOPE)
+endfunction(_TensorFlowLite_import)
+
+_TensorFlowLite_import()