Use Protocol Buffer 3.5.2 (#2963)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 30 Jan 2019 23:55:52 +0000 (08:55 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 30 Jan 2019 23:55:52 +0000 (08:55 +0900)
This commit integrates protocol buffer 3.5.2 (instead of 3.6.1) as a
nncc external package.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
CMakeLists.txt
cmake/packages/ProtobufConfig.cmake
cmake/packages/ProtobufSourceConfig.cmake

index abd31fe..859c017 100644 (file)
@@ -34,7 +34,7 @@ message(STATUS "Use '${CMAKE_BUILD_TYPE}' configuration")
 ### Configuration
 ###
 option(DOWNLOAD_PROTOBUF "Download Protocol Buffer source" ON)
-option(BUILD_PROTOBUF "Locally build Protocol Buffer from the downloaded source" OFF)
+option(BUILD_PROTOBUF "Locally build Protocol Buffer from the downloaded source" ON)
 option(DOWNLOAD_EIGEN "Download Eigen source" ON)
 option(DOWNLOAD_FARMHASH "Download farmhash source" ON)
 option(DOWNLOAD_GEMMLOWP "Download GEMM low precesion library source" ON)
index 2bacde6..ddd7c4d 100644 (file)
@@ -1,4 +1,4 @@
-# TODO Use CONFIG version after bug fix
+# NOTE This function is unused, but remains for future reference
 function(_Protobuf_module_import)
   # Let's use find_package here not to export unnecessary definitions
   find_package(Protobuf MODULE QUIET)
@@ -25,7 +25,7 @@ endfunction(_Protobuf_module_import)
 function(_Protobuf_import)
   # Let's use find_package here not to export unnecessary definitions
   # NOTE Here we use "exact" match to avoid possible infinite loop
-  find_package(Protobuf EXACT 3.6.1)
+  find_package(protobuf EXACT 3.5.2 QUIET)
 
   if(NOT protobuf_FOUND)
     set(Protobuf_FOUND FALSE PARENT_SCOPE)
@@ -102,10 +102,8 @@ function(_Protobuf_build)
   message(STATUS "Succeeded in building Protocol Buffer")
 endfunction(_Protobuf_build)
 
-# TODO Use Protocol Buffer 3.6.1
 _Protobuf_build()
-#_Protobuf_import()
-_Protobuf_module_import()
+_Protobuf_import()
 
 if(Protobuf_FOUND)
   function(Protobuf_Generate PREFIX OUTPUT_DIR PROTO_DIR)
@@ -128,7 +126,7 @@ if(Protobuf_FOUND)
 
     add_custom_command(OUTPUT ${OUTPUT_FILES}
                        COMMAND ${CMAKE_COMMAND} -E make_directory "${abs_output_dir}"
-                       COMMAND "$<TARGET_FILE:protoc>" --cpp_out "${abs_output_dir}" -I "${abs_proto_dir}" ${PROTO_FILES}
+                       COMMAND "$<TARGET_FILE:protobuf::protoc>" --cpp_out "${abs_output_dir}" -I "${abs_proto_dir}" ${PROTO_FILES}
                        DEPENDS ${PROTO_FILES})
 
     set(${PREFIX}_SOURCES ${OUTPUT_FILES} PARENT_SCOPE)
index fa95f39..89176eb 100644 (file)
@@ -7,7 +7,7 @@ function(_ProtobufSource_import)
   nncc_include(ExternalSourceTools)
   nncc_include(OptionTools)
 
-  envoption(PROTOBUF_URL https://github.com/protocolbuffers/protobuf/archive/v3.6.1.tar.gz)
+  envoption(PROTOBUF_URL https://github.com/protocolbuffers/protobuf/archive/v3.5.2.tar.gz)
 
   ExternalSource_Download(PROTOBUF ${PROTOBUF_URL})