cmake: require protobuf, generate mnode protobuf test lib
This commit is contained in:
parent
97032e9c0f
commit
e316f2e95a
2 changed files with 22 additions and 0 deletions
|
@ -7,5 +7,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
|
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
|
||||||
|
|
||||||
|
find_package(Protobuf REQUIRED)
|
||||||
|
#protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS proto/service.proto)
|
||||||
|
add_library(mnode-proto proto/service.proto)
|
||||||
|
target_link_libraries(mnode-proto PUBLIC protobuf::libprotobuf)
|
||||||
|
target_include_directories(mnode-proto PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
protobuf_generate(TARGET mnode-proto)
|
||||||
|
|
||||||
add_subdirectory(external)
|
add_subdirectory(external)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
15
proto/service.proto
Normal file
15
proto/service.proto
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package mesytec.mnode;
|
||||||
|
|
||||||
|
message SearchRequest {
|
||||||
|
string query = 1;
|
||||||
|
int32 page_number = 2;
|
||||||
|
int32 results_per_page = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Ping {
|
||||||
|
}
|
||||||
|
|
||||||
|
message Pong {
|
||||||
|
}
|
Loading…
Reference in a new issue