File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99option (ALLOW_CUDA "Try to find and use CUDA." ON )
1010option (REQUIRE_CUDA "Make sure to find and use CUDA (implies ALLOW_CUDA)." OFF )
1111set (TENSORFLOW_TAG "v${version} " CACHE STRING "The tensorflow release tag to be checked out (default v${version} )." )
12+ option (SYSTEM_PROTOBUF "Link to system protobuf." OFF )
1213set (TARGET_CXX_STANDARD "cxx_std_11" CACHE STRING "C++ standard to be enforced when linking to TensorflowCC targets (e.g., cxx_std_11)." )
1314
1415# -------------
@@ -53,6 +54,17 @@ target_link_libraries(
5354 "${CMAKE_INSTALL_PREFIX} /lib/libtensorflow_cc.so.${PROJECT_VERSION_MAJOR} "
5455 dl pthread
5556)
57+ if (SYSTEM_PROTOBUF)
58+ find_package (Protobuf REQUIRED )
59+ target_include_directories (
60+ tensorflow_cc INTERFACE
61+ "${Protobuf_INCLUDE_DIRS} "
62+ )
63+ target_link_libraries (
64+ tensorflow_cc INTERFACE
65+ "${Protobuf_LIBRARIES} "
66+ )
67+ endif ()
5668
5769# ----------------------------------------
5870# Configure CMake Config and Version Files
You can’t perform that action at this time.
0 commit comments