### 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)
-# 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)
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)
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)
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)
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})