${zlib_STATIC_LIBRARIES})
endif (systemlib_ZLIB)
-if (protobuf_PROTOBUF)
+if (systemlib_PROTOBUF)
set(tensorflow_EXTERNAL_LIBRARIES ${tensorflow_EXTERNAL_LIBRARIES}
${PROTOBUF_LIBRARIES})
-else (protobuf_PROTOBUF)
+else (systemlib_PROTOBUF)
set(tensorflow_EXTERNAL_LIBRARIES ${tensorflow_EXTERNAL_LIBRARIES}
${protobuf_STATIC_LIBRARIES})
-endif (protobuf_PROTOBUF)
+endif (systemlib_PROTOBUF)
if (systemlib_ABSEIL_CPP)
set(tensorflow_EXTERNAL_LIBRARIES ${tensorflow_EXTERNAL_LIBRARIES}
${abseil_cpp_STATIC_LIBRARIES})
endif (systemlib_ABSEIL_CPP)
-if (systemlib_GRPC)
- set(tensorflow_EXTERNAL_LIBRARIES ${tensorflow_EXTERNAL_LIBRARIES}
- ${GRPC_LIBRARIES} ${CARES_LIBRARIES})
-else (systemlib_GRPC)
- set(tensorflow_EXTERNAL_LIBRARIES ${tensorflow_EXTERNAL_LIBRARIES}
- ${grpc_STATIC_LIBRARIES})
-endif (systemlib_GRPC)
-
message("Library Options = [${tensorflow_EXTERNAL_LIBRARIES}]")
set(tensorflow_EXTERNAL_DEPENDENCIES
farmhash_copy_headers_to_destination
highwayhash_copy_headers_to_destination
nsync_copy_headers_to_destination
- protobuf
+ protobuf_
eigen
gemmlowp
cub
include(grpc)
include_directories(${GRPC_INCLUDE_DIRS})
# Place boringssl after grpc as grpc depends on boringssl.
- list(APPEND tensorflow_EXTERNAL_LIBRARIES ${grpc_STATIC_LIBRARIES})
- list(APPEND tensorflow_EXTERNAL_DEPENDENCIES grpc)
+ list(APPEND tensorflow_EXTERNAL_DEPENDENCIES grpc_)
+
+ if (systemlib_GRPC)
+ set(tensorflow_EXTERNAL_LIBRARIES ${tensorflow_EXTERNAL_LIBRARIES}
+ ${GRPC_LIBRARIES} ${CARES_LIBRARIES})
+ else (systemlib_GRPC)
+ set(tensorflow_EXTERNAL_LIBRARIES ${tensorflow_EXTERNAL_LIBRARIES}
+ ${grpc_STATIC_LIBRARIES})
+ endif (systemlib_GRPC)
+
if(tensorflow_ENABLE_SSL_SUPPORT)
list(APPEND tensorflow_EXTERNAL_LIBRARIES ${boringssl_STATIC_LIBRARIES})
list(APPEND tensorflow_EXTERNAL_DEPENDENCIES boringssl)
# To meet DEPENDS grpc from other projects.
# If we hit this line, grpc is already built and installed to the system.
- add_custom_target(grpc)
+ add_custom_target(grpc_)
add_custom_target(grpc_copy_headers_to_destination)
# Locate grpc's executables for tf_core_framework.cmake.
add_definitions(-DGRPC_ARES=0)
- ExternalProject_Add(grpc
+ ExternalProject_Add(grpc_
PREFIX grpc
DEPENDS ${grpc_DEPENDS}
GIT_REPOSITORY ${GRPC_URL}
# To meet DEPENDS protobuf from other projects.
# If we hit this line, protobuf is already built and installed to the system.
- add_custom_target(protobuf)
+ add_custom_target(protobuf_)
add_custom_target(protobuf_copy_headers_to_destination)
else (systemlib_PROTOBUF)
set(PROTOBUF_PROTOC_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/protoc)
endif()
- ExternalProject_Add(protobuf
+ ExternalProject_Add(protobuf_
PREFIX protobuf
DEPENDS zlib
GIT_REPOSITORY ${PROTOBUF_URL}
add_library(tf_core_distributed_runtime OBJECT ${tf_core_distributed_runtime_srcs})
add_dependencies(tf_core_distributed_runtime
- tf_core_cpu grpc
+ tf_core_cpu grpc_
)
########################################################
"${CMAKE_CURRENT_BINARY_DIR}/${REL_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${ROOT_DIR} ${ABS_FIL} -I ${PROTOBUF_INCLUDE_DIRS}
- DEPENDS ${ABS_FIL} protobuf
+ DEPENDS ${ABS_FIL} protobuf_
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM )
endforeach()
"${CMAKE_CURRENT_BINARY_DIR}/${REL_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --grpc_out ${CMAKE_CURRENT_BINARY_DIR} --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --plugin protoc-gen-grpc=${GRPC_BUILD}/grpc_cpp_plugin -I ${ROOT_DIR} ${ABS_FIL} -I ${PROTOBUF_INCLUDE_DIRS}
- DEPENDS ${ABS_FIL} protobuf grpc
+ DEPENDS ${ABS_FIL} protobuf_ grpc_
COMMENT "Running C++ protocol buffer grpc compiler on ${FIL}"
VERBATIM )
endforeach()
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/tf_python/${REL_DIR}/${FIL_WE}_pb2.py"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --python_out ${CMAKE_CURRENT_BINARY_DIR}/tf_python/ -I ${ROOT_DIR} -I ${PROTOBUF_INCLUDE_DIRS} ${ABS_FIL}
- DEPENDS ${PROTOBUF_PROTOC_EXECUTABLE} protobuf
+ DEPENDS ${PROTOBUF_PROTOC_EXECUTABLE} protobuf_
COMMENT "Running Python protocol buffer compiler on ${FIL}"
VERBATIM )
endforeach()
"${CMAKE_CURRENT_BINARY_DIR}/${REL_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${ROOT_DIR} ${ABS_FIL} -I ${PROTOBUF_INCLUDE_DIRS}
- DEPENDS ${ABS_FIL} protobuf
+ DEPENDS ${ABS_FIL} protobuf_
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM )
endforeach()
install(DIRECTORY ${tensorflow_source_dir}/tensorflow/stream_executor/
DESTINATION include/tensorflow/stream_executor
FILES_MATCHING PATTERN "*.h")
-# google protobuf headers
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src/google/
- DESTINATION include/google
- FILES_MATCHING PATTERN "*.h")
+if (systemlib_PROTOBUF)
+ message ("Skip installing protobuf headers.")
+else (systemlib_PROTOBUF)
+ # google protobuf headers
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src/google/
+ DESTINATION include/google
+ FILES_MATCHING PATTERN "*.h")
+endif (systemlib_PROTOBUF)
# Eigen directory
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/eigen/src/eigen/Eigen/
DESTINATION include/Eigen)
add_dependencies(${proto_text} tf_core_lib)
if(tensorflow_ENABLE_GRPC_SUPPORT)
- add_dependencies(${proto_text} grpc)
+ add_dependencies(${proto_text} grpc_)
endif(tensorflow_ENABLE_GRPC_SUPPORT)
file(GLOB_RECURSE tf_tools_transform_graph_lib_srcs