braft icon indicating copy to clipboard operation
braft copied to clipboard

Simplify and clarify cmake script and build instruction

Open gavinchou opened this issue 4 years ago • 3 comments

Replace include(FindProtobuf) with "manual detection" of protobuffer because:

  1. We can make the names of dependencies consistent in a form of XXX_INCLUDE_PATH and XXX_LIB. Before replacing, we may have to provide Protobuf_INCLUDE_DIR and Protobuf_LIBRARY too, which is inconsistent with other libs.
  2. If the protoc's version, the protoc is detected by include(FindProtobuf), is different (there are several versions installed) from the libprotobuf provided, it may lead to version inconsistency.

gavinchou avatar Aug 08 '19 07:08 gavinchou

Replace include(FindProtobuf) with "manual detection" of protobuffer because:

  1. We can make the names of dependencies consistent in a form of XXX_INCLUDE_PATH and XXX_LIB. Before replacing, we may have to provide Protobuf_INCLUDE_DIR and Protobuf_LIBRARY too, which is inconsistent with other libs.
  2. If the protoc's version, the protoc is detected by include(FindProtobuf), is different (there are several versions installed) from the libprotobuf provided, it may lead to version inconsistency.

Please check travis-ci

PFZheng avatar Aug 09 '19 05:08 PFZheng

-- Found Threads: TRUE
CMake Error at /usr/local/cmake-3.12.4/share/cmake-3.12/Modules/FindProtobuf.cmake:425 (file): file STRINGS file "/home/travis/build/brpc/braft/PROTOBUF_INCLUDE_PATH/google/protobuf/stubs/common.h" cannot be read. Call Stack (most recent call first): CMakeLists.txt:33 (include)

Edward-xk avatar Aug 18 '19 15:08 Edward-xk

A nice PR!

jovany-wang avatar Nov 10 '20 07:11 jovany-wang