Browse Source

Use CMake's FindProtobuf

pull/3213/head
Dark Dragon 3 years ago
parent
commit
fde83aa1a4
1 changed files with 4 additions and 10 deletions
  1. +4
    -10
      cpp/CMakeLists.txt

+ 4
- 10
cpp/CMakeLists.txt View File

@ -176,14 +176,11 @@ if (USE_RE2)
find_required_library (RE2 re2/re2.h re2 "Google RE2")
endif ()
find_package(Protobuf REQUIRED)
if (USE_PROTOBUF_LITE)
find_required_library (PROTOBUF google/protobuf/message_lite.h protobuf-lite
"Google Protocol Buffers")
check_library_version (PC_PROTOBUF protobuf-lite>=2.4)
set(PROTOBUF_LIB ${Protobuf_LITE_LIBRARIES})
else ()
find_required_library (PROTOBUF google/protobuf/message_lite.h protobuf
"Google Protocol Buffers")
check_library_version (PC_PROTOBUF protobuf>=2.4)
set(PROTOBUF_LIB ${Protobuf_LIBRARIES})
endif ()
find_required_library (ICU_UC unicode/uchar.h icuuc "ICU")
@ -199,9 +196,6 @@ if (USE_ICU_REGEXP OR BUILD_GEOCODER)
list (APPEND ICU_LIB ${ICU_I18N_LIB})
endif ()
find_required_program (PROTOC protoc
"Google Protocol Buffers compiler (protoc)")
if (REGENERATE_METADATA)
find_required_program (JAVA java
"Java Runtime Environment")
@ -239,7 +233,7 @@ set (
)
add_custom_command (
COMMAND ${PROTOC_BIN} --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/src/phonenumbers/
COMMAND ${Protobuf_PROTOC_EXECUTABLE} --cpp_out=${CMAKE_CURRENT_SOURCE_DIR}/src/phonenumbers/
--proto_path=${RESOURCES_DIR} ${PROTOBUF_SOURCES}
OUTPUT ${PROTOBUF_OUTPUT}


Loading…
Cancel
Save