Skip to content

Commit

Permalink
Merge pull request #3 from ic97usop/richard/messaging/protobuf-deseri…
Browse files Browse the repository at this point in the history
…alize

Richard/messaging/protobuf deserialize
  • Loading branch information
ic97usop committed Apr 26, 2016
2 parents 015252a + 0ced279 commit bbf5ea0
Show file tree
Hide file tree
Showing 10 changed files with 2,645 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#cmake
cmake_minimum_required (VERSION 2.8)

#project
project(protobuf_deserializer)

#compiler
set(CMAKE_CXX_FLAGS "-g -Wall -Werror -std=c++11")

#search protobuf in subdirectoryprotobuf
add_subdirectory(protofiles)


include_directories(${CMAKE_CURRENT_BINARY_DIR})

#generate executable
file(GLOB_RECURSE sources "./src/*.cpp")
file(GLOB_RECURSE headers "./include/*.h")
add_executable(protobuf_deserializer ${sources} ${headers})

target_link_libraries(protobuf_deserializer proto ${PROTOBUF_LIBRARY})

26 changes: 26 additions & 0 deletions messaging/protobuf_deserializer/protobuf_deserializer/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Download and build google protopuf

- Download https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz

- Installation: https://github.com/google/protobuf/blob/master/src/README.md



Install CMake


Build protobuf_deserializer
Build:

- $ mkdir build

- $ cd build

- $ cmake ..

- $ make


Run:

- $ ./protobuf_deserializer
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#minium cmake version
cmake_minimum_required (VERSION 2.8)

#protobuf
include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})

#generate the h and cc files
PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER "header.proto" "MsgCameraImage.proto")
ADD_LIBRARY(proto ${PROTO_HEADER} ${PROTO_SRC})
Loading

0 comments on commit bbf5ea0

Please sign in to comment.