braft
braft copied to clipboard
Simplify and clarify cmake script and build instruction
Replace include(FindProtobuf)
with "manual detection" of protobuffer because:
- We can make the names of dependencies consistent in a form of
XXX_INCLUDE_PATH
andXXX_LIB
. Before replacing, we may have to provideProtobuf_INCLUDE_DIR
andProtobuf_LIBRARY
too, which is inconsistent with other libs. - 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.
Replace
include(FindProtobuf)
with "manual detection" of protobuffer because:
- We can make the names of dependencies consistent in a form of
XXX_INCLUDE_PATH
andXXX_LIB
. Before replacing, we may have to provideProtobuf_INCLUDE_DIR
andProtobuf_LIBRARY
too, which is inconsistent with other libs.- 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
-- 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)
A nice PR!