set(TENSORFLOW_BASE ${CMAKE_CURRENT_SOURCE_DIR}/tensorflow)
set(TENSORFLOW_LITE_BASE ${TENSORFLOW_BASE}/tensorflow/contrib/lite)
+# Eigen 3
+file(GLOB_RECURSE EIGEN3_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/eigen/*.h")
+
+# NOTE From 3.x, CMake supports INTERFACE library feature. Unfortunately,
+# CMake 2.8.12 (which Ubuntu 14.04 provides) does not support this
+# library feature.
+add_library(eigen3 STATIC ${EIGEN3_HDRS})
+set_target_properties(eigen3 PROPERTIES LINKER_LANGUAGE CXX)
+target_include_directories(eigen3 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/eigen")
+
#
# Protocol Buffer (>= 3.5.1)
#
list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/")
list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/tensorflow")
-list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/eigen")
list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/gemmlowp")
list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/neon_2_sse")
list(APPEND TFLITE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/farmhash/src")
add_library(tensorflow_lite ${TFLITE_SRCS})
target_include_directories(tensorflow_lite PUBLIC ${TFLITE_INCLUDES})
target_compile_definitions(tensorflow_lite PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK")
-target_link_libraries(tensorflow_lite pthread dl)
+target_link_libraries(tensorflow_lite eigen3 pthread dl)
install(TARGETS tensorflow_lite ARCHIVE DESTINATION lib)