From 1cacb356ca1fb4d1dbbadf0c7cb4d281de5327e7 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 7 Oct 2022 16:03:14 -0400 Subject: [PATCH] search TF deps from env; eliminate errors Follow-up of #1975 to fix #1957. Signed-off-by: Jinzhe Zeng --- source/cmake/Findtensorflow.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/cmake/Findtensorflow.cmake b/source/cmake/Findtensorflow.cmake index cd50ba2863..07c3cbd16e 100644 --- a/source/cmake/Findtensorflow.cmake +++ b/source/cmake/Findtensorflow.cmake @@ -149,15 +149,16 @@ find_path(TensorFlow_INCLUDE_DIRS_GOOGLE PATH_SUFFIXES "/include" NO_DEFAULT_PATH ) -message(STATUS proto ${TensorFlow_INCLUDE_DIRS_GOOGLE}) if (NOT TensorFlow_INCLUDE_DIRS_GOOGLE) message(STATUS "Protobuf headers are not found in the directory of TensorFlow, assuming external protobuf was used to build TensorFlow") # try to find from ldd list of TF library # a warning is threw here, just ignore it file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR TensorFlow_LINKED_LIBRARIES + UNRESOLVED_DEPENDENCIES_VAR TensorFlow_LINKED_LIBRARIES_UNRESOLVED LIBRARIES ${TensorFlowFramework_LIBRARY} POST_INCLUDE_REGEXES "^.+protobuf\..+$" + DIRECTORIES $ENV{LD_LIBRARY_PATH} ) # search protobuf from linked libraries foreach(_lib ${TensorFlow_LINKED_LIBRARIES})