ADD: added protobuf lib
This commit is contained in:
@@ -29,7 +29,11 @@ set(protobuf_BUILD_EXAMPLES OFF CACHE INTERNAL "")
|
||||
add_subdirectory(libs/protobuf EXCLUDE_FROM_ALL)
|
||||
include(protobuf)
|
||||
|
||||
protobuf_generate_cpp(PROTO_PATH tests/protos CPP_PATH tests/protos/src HPP_PATH tests/protos/include)
|
||||
|
||||
if(protobuf_VERBOSE)
|
||||
message(STATUS "Using Protocol Buffers ${protobuf_VERSION}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
add_library(whisper-com STATIC
|
||||
@@ -38,19 +42,36 @@ add_library(whisper-com STATIC
|
||||
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries(whisper-com
|
||||
loguru
|
||||
cppzmq
|
||||
libzmq
|
||||
libprotobuf
|
||||
)
|
||||
|
||||
add_dependencies(whisper-com protoc)
|
||||
|
||||
target_include_directories(whisper-com PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
src)
|
||||
|
||||
add_executable(main
|
||||
|
||||
src/main.cpp
|
||||
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
#
|
||||
# Everything TEST related
|
||||
#
|
||||
@@ -62,4 +83,6 @@ 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()
|
||||
|
||||
Reference in New Issue
Block a user