aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/cmake/external/protobuf.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/cmake/external/protobuf.cmake')
-rw-r--r--tensorflow/contrib/cmake/external/protobuf.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/tensorflow/contrib/cmake/external/protobuf.cmake b/tensorflow/contrib/cmake/external/protobuf.cmake
new file mode 100644
index 0000000000..dc74e9a338
--- /dev/null
+++ b/tensorflow/contrib/cmake/external/protobuf.cmake
@@ -0,0 +1,22 @@
+include (ExternalProject)
+
+set(PROTOBUF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src)
+set(PROTOBUF_URL https://github.com/google/protobuf/releases/download/v3.0.0/protobuf-cpp-3.0.0.zip)
+set(PROTOBUF_HASH SHA256=e886ea7d08267fc3d866ac42d6dd7461ae11c491836adef6f34c04cad0be3078)
+set(PROTOBUF_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/libprotobuf.a)
+set(PROTOBUF_PROTOC_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/protoc)
+
+ExternalProject_Add(protobuf
+ PREFIX protobuf
+ URL ${PROTOBUF_URL}
+ DOWNLOAD_DIR "${DOWNLOAD_LOCATION}"
+ BUILD_IN_SOURCE 1
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/protobuf/src/protobuf
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} cmake/ -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+ INSTALL_COMMAND ""
+ CMAKE_CACHE_ARGS
+ -DCMAKE_BUILD_TYPE:STRING=Release
+ -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
+ -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
+)
+