Improve Protocol Buffers info

This commit is contained in:
Carles Fernandez 2019-04-21 11:51:49 +02:00
parent 2cba1c5e0a
commit b3ca9bda99
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 123 additions and 116 deletions

View File

@ -1789,17 +1789,15 @@ endif()
################################################################################
# Protocol Buffers https://github.com/protocolbuffers/protobuf
################################################################################
option(ENABLE_PROTOBUF "Enable Protocol Buffers" ON)
if(ENABLE_PROTOBUF)
set(Protobuf_VERSION "0.0.0")
find_package(Protobuf)
set_package_properties(Protobuf PROPERTIES
set(Protobuf_VERSION "0.0.0")
find_package(Protobuf)
set_package_properties(Protobuf PROPERTIES
URL "https://developers.google.com/protocol-buffers/"
DESCRIPTION "A language-neutral, platform-neutral extensible mechanism for serializing structured data"
PURPOSE "Used to serialize output data in a way that can be read by other applications."
TYPE REQUIRED
)
if(Protobuf_FOUND AND CMAKE_VERSION VERSION_LESS 3.9)
)
if(Protobuf_FOUND AND CMAKE_VERSION VERSION_LESS 3.9)
add_library(protobuf::libprotobuf SHARED IMPORTED)
set_target_properties(protobuf::libprotobuf PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
@ -1813,8 +1811,8 @@ if(ENABLE_PROTOBUF)
IMPORTED_LOCATION "${Protobuf_PROTOC_EXECUTABLE}"
INTERFACE_LINK_LIBRARIES "${Protobuf_PROTOC_LIBRARY}"
)
endif()
if(Protobuf_FOUND AND CMAKE_CROSSCOMPILING)
endif()
if(Protobuf_FOUND AND CMAKE_CROSSCOMPILING)
find_program(PROTOC_EXECUTABLE protoc
HINTS
/usr/local/bin/
@ -1829,8 +1827,8 @@ if(ENABLE_PROTOBUF)
else()
message(FATAL ERROR "Please install the Protocol Buffers compiter v{${Protobuf_VERSION}} in the host machine")
endif()
endif()
if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSION} VERSION_LESS ${GNSSSDR_PROTOBUF_MIN_VERSION}))
endif()
if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSION} VERSION_LESS ${GNSSSDR_PROTOBUF_MIN_VERSION}))
unset(Protobuf_PROTOC_EXECUTABLE)
if(CMAKE_CROSSCOMPILING)
if(NOT Protobuf_FOUND)
@ -1909,11 +1907,11 @@ if(ENABLE_PROTOBUF)
set_package_properties(Protobuf PROPERTIES
PURPOSE "Protocol Buffers v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'."
)
endif()
endif()
################################################################################
# Doxygen - http://www.doxygen.nl (OPTIONAL, used if found)
################################################################################

View File

@ -286,6 +286,14 @@ In case the GnuTLS library with openssl extensions package is not available in y
#### Install [Protocol Buffers](https://developers.google.com/protocol-buffers/ "Protocol Buffers' Homepage"), a portable mechanism for serialization of structured data:
GNSS-SDR requires Protocol Buffers v3.0.0 or later. If the packages that come with your distribution are older, you will need to install it manually. First, install the dependencies:
~~~~~~
$ sudo apt-get install autoconf automake libtool curl make g++ unzip
~~~~~~
and then:
~~~~~~
$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protobuf-cpp-3.7.1.tar.gz
$ tar xvfz protobuf-cpp-3.7.1.tar.gz
@ -294,6 +302,7 @@ $ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
~~~~~~