Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use conan recipe foxglove-schemas-protobuf #499

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 6 additions & 19 deletions cpp/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
cmake_minimum_required(VERSION 3.15)
project(FoxgloveWebSocketExamples CXX)

find_package(Protobuf 3 REQUIRED)
find_package(FlatBuffers REQUIRED)
find_package(foxglove-schemas-protobuf CONFIG REQUIRED)
find_package(foxglove-websocket REQUIRED)

FILE(GLOB all_protos "proto/foxglove/*.proto")

FOREACH(f ${all_protos})
file(RELATIVE_PATH f ${CMAKE_CURRENT_SOURCE_DIR}/proto ${f})
STRING(REGEX REPLACE "\\.proto$" "" f ${f})
LIST(APPEND proto_sources "autogenerated_protobuf/${f}.pb.h")
LIST(APPEND proto_sources "autogenerated_protobuf/${f}.pb.cc")
ENDFOREACH(f)

add_custom_command(
OUTPUT ${proto_sources}
COMMAND ${CMAKE_COMMAND} -E make_directory autogenerated_protobuf
COMMAND ${Protobuf_PROTOC_EXECUTABLE} --proto_path=${CMAKE_CURRENT_SOURCE_DIR}/proto --cpp_out=autogenerated_protobuf ${all_protos}
)

FILE(GLOB flatbuffers_schemas "flatbuffers/*.fbs")
build_flatbuffers(
"${flatbuffers_schemas}" # flatbuffers_schemas
Expand All @@ -31,9 +16,11 @@ build_flatbuffers(
"" # copy_text_schemas_dir
)

add_executable(example_server_protobuf src/example_server_protobuf.cpp ${proto_sources})
target_include_directories(example_server_protobuf PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/autogenerated_protobuf)
target_link_libraries(example_server_protobuf foxglove-websocket::foxglove-websocket protobuf::libprotobuf)
add_executable(example_server_protobuf src/example_server_protobuf.cpp)
target_link_libraries(example_server_protobuf
foxglove-schemas-protobuf::foxglove-schemas-protobuf
foxglove-websocket::foxglove-websocket
)

add_executable(example_server_flatbuffers src/example_server_flatbuffers.cpp ${flatbuffer_sources})
add_dependencies(example_server_flatbuffers flatbuffers_generated_schemas)
Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class FoxgloveWebSocketExamplesConan(ConanFile):

def requirements(self):
self.requires("flatbuffers/23.5.26")
self.requires("foxglove-schemas-protobuf/0.1.0")
self.requires("foxglove-websocket/1.1.0")
self.requires("protobuf/3.21.4")
self.requires("zlib/1.2.13")

def layout(self):
Expand Down
29 changes: 0 additions & 29 deletions cpp/examples/proto/foxglove/ArrowPrimitive.proto

This file was deleted.

73 changes: 0 additions & 73 deletions cpp/examples/proto/foxglove/CameraCalibration.proto

This file was deleted.

30 changes: 0 additions & 30 deletions cpp/examples/proto/foxglove/CircleAnnotation.proto

This file was deleted.

20 changes: 0 additions & 20 deletions cpp/examples/proto/foxglove/Color.proto

This file was deleted.

22 changes: 0 additions & 22 deletions cpp/examples/proto/foxglove/CompressedImage.proto

This file was deleted.

21 changes: 0 additions & 21 deletions cpp/examples/proto/foxglove/CubePrimitive.proto

This file was deleted.

27 changes: 0 additions & 27 deletions cpp/examples/proto/foxglove/CylinderPrimitive.proto

This file was deleted.

27 changes: 0 additions & 27 deletions cpp/examples/proto/foxglove/FrameTransform.proto

This file was deleted.

11 changes: 0 additions & 11 deletions cpp/examples/proto/foxglove/GeoJSON.proto

This file was deleted.

40 changes: 0 additions & 40 deletions cpp/examples/proto/foxglove/Grid.proto

This file was deleted.

17 changes: 0 additions & 17 deletions cpp/examples/proto/foxglove/ImageAnnotations.proto

This file was deleted.

14 changes: 0 additions & 14 deletions cpp/examples/proto/foxglove/KeyValuePair.proto

This file was deleted.

Loading
Loading