Do NOT use CMAKE_CURRENT_SOURCE_DIR for tflite build (#4761)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 18 Mar 2019 01:29:09 +0000 (10:29 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 18 Mar 2019 01:29:09 +0000 (10:29 +0900)
The current tflite build script uses the hardcoded location of TensorFlow
source code.

This commit removes such hardcoded location and uses TensorFlowSource_DIR
variable instead.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
externals/CMakeLists.txt

index 4ef3d21..ce6d3cb 100644 (file)
@@ -3,9 +3,6 @@ if(NOT BUILD_TENSORFLOW_LITE)
   return()
 endif(NOT BUILD_TENSORFLOW_LITE)
 
-set(TENSORFLOW_BASE ${CMAKE_CURRENT_SOURCE_DIR}/tensorflow)
-set(TENSORFLOW_LITE_BASE ${TENSORFLOW_BASE}/tensorflow/contrib/lite)
-
 # Required source & package
 nnfw_find_package(AbslSource REQUIRED)
 nnfw_find_package(Eigen REQUIRED)
@@ -14,6 +11,8 @@ nnfw_find_package(FlatBuffersSource REQUIRED)
 nnfw_find_package(GEMMLowpSource REQUIRED)
 nnfw_find_package(TensorFlowSource REQUIRED)
 
+set(TENSORFLOW_LITE_BASE ${TensorFlowSource_DIR}/tensorflow/contrib/lite)
+
 #
 # Tensorflow Lite library
 #
@@ -49,7 +48,7 @@ list(APPEND TFLITE_SRCS ${TFLITE_PROFILING_SRCS})
 
 list(APPEND TFLITE_SRCS "${FarmhashSource_DIR}/src/farmhash.cc")
 
-list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/tensorflow")
+list(APPEND TFLITE_INCLUDES "${TensorFlowSource_DIR}")
 list(APPEND TFLITE_INCLUDES "${AbslSource_DIR}")
 list(APPEND TFLITE_INCLUDES "${GEMMLowpSource_DIR}")
 list(APPEND TFLITE_INCLUDES "${FarmhashSource_DIR}/src")