TensorFlowConfig.cmake checks running result only.
When prebuilt libtensorflow library is built from Ubuntu 18.04,
and nncc is going to be built on Ubuntu 16.04, it says:
"you need tensorflow version 1.12.0".
This patch will check build error also.
Then, it prints error message to guide the developers
to use libtensorflow built on same version of Ubuntu.
Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
LINK_LIBRARIES ${TensorFlow_LIB}
ARGS ${TENSORFLOW_VERSION_REQUIRED})
+ if(NOT COMPILE_RESULT_VAR)
+ message(STATUS "Failed to build TensorFlowVersionChecker. Your libtensorflow may be built on different version of Ubuntu.")
+ message(STATUS "Found TensorFlow: FALSE")
+ set(TensorFlow_FOUND FALSE PARENT_SCOPE)
+ return()
+ endif(NOT COMPILE_RESULT_VAR)
+
if(NOT RUN_RESULT_VAR EQUAL 0)
message(STATUS "you need tensorflow version ${TENSORFLOW_VERSION_REQUIRED}")
message(STATUS "Found TensorFlow: FALSE")