ADD: added protobuf compile options and a folder for all .proto Files

This commit is contained in:
Henry Winkel
2022-10-22 16:47:34 +02:00
parent a9eb981de2
commit 4e4fdb5b23
3 changed files with 10 additions and 8 deletions

View File

@@ -29,6 +29,7 @@ set(protobuf_BUILD_EXAMPLES OFF CACHE INTERNAL "")
add_subdirectory(libs/protobuf EXCLUDE_FROM_ALL)
include(protobuf)
protobuf_generate_cpp(PROTO_PATH include/WHISPER/Messages/Protos/ CPP_PATH include/WHISPER/Messages/Protos HPP_PATH include/WHISPER/Messages/Protos)
if(protobuf_VERBOSE)
message(STATUS "Using Protocol Buffers ${protobuf_VERSION}")
@@ -59,17 +60,16 @@ target_include_directories(whisper-com PUBLIC
add_executable(main
src/main.cpp
../include/WHISPER/Messages/Protos/join.pb.cc
)
add_dependencies(main protoc)
target_link_libraries(main
whisper-com
loguru
libprotobuf
)
protobuf_generate_cpp(PROTO_PATH protos CPP_PATH include/WHISPER/Messages/Protos HPP_PATH include/WHISPER/Messages/Protos)
#
@@ -83,6 +83,5 @@ IF (${TEST_WHISPER_COMMUNICATION_LIBRARY})
target_link_libraries(test_test Catch2::Catch2 whisper-com loguru)
catch_discover_tests(test_test)
add_dependencies(test_test protoc)
ENDIF()