-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ic97usop/richard/messaging/protobuf-deseri…
…alize Richard/messaging/protobuf deserialize
- Loading branch information
Showing
10 changed files
with
2,645 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
messaging/protobuf_deserializer/protobuf_deserializer/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
26
messaging/protobuf_deserializer/protobuf_deserializer/Readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
11 changes: 11 additions & 0 deletions
11
messaging/protobuf_deserializer/protobuf_deserializer/protofiles/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
Oops, something went wrong.