Allow multiple TensorFlowLite package request (#4771)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 18 Mar 2019 07:25:44 +0000 (16:25 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 18 Mar 2019 07:25:44 +0000 (16:25 +0900)
The current implementation does not work in the presence of multiple
nnfw_find_package(TensorFlowLite ...) invocations.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
cmake/packages/TensorFlowLiteConfig.cmake

index 1a318a4..d5924cd 100644 (file)
@@ -1,3 +1,9 @@
+# NOTE This line prevents multiple definitions of tensorflow-lite target
+if(TARGET tensorflow-lite)
+  set(TensorFlowLite_FOUND TRUE)
+  return()
+endif(TARGET tensorflow-lite)
+
 if(BUILD_TENSORFLOW_LITE)
   macro(return_unless VAR)
     if(NOT ${VAR})