1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-07-07 12:32:57 +00:00

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