diff --git a/src/flatb/CMakeLists.txt b/src/flatb/CMakeLists.txt index 98601d4..b9dc5da 100644 --- a/src/flatb/CMakeLists.txt +++ b/src/flatb/CMakeLists.txt @@ -1,14 +1,27 @@ cmake_minimum_required(VERSION 3.11) +list(APPEND SCHEMA_FLAGS "--gen-object-api" "--scoped-enums" "--gen-name-strings" "--cpp-std=c++17" "--cpp-static-reflection") + flatbuffers_generate_headers( TARGET fbschemas - SCHEMAS "raft_types.fbs" "messaging_service.fbs" - FLAGS "--grpc" "--gen-object-api" "--scoped-enums" "--gen-name-strings" "--cpp-std=c++17" "--cpp-static-reflection" + SCHEMAS "raft_types.fbs" + FLAGS ${SCHEMA_FLAGS} +) +flatbuffers_generate_headers( + TARGET fbservice + SCHEMAS "messaging_service.fbs" + FLAGS "--grpc" ${SCHEMA_FLAGS} ) + add_library(${PROJECT_NAME}-fb OBJECT) -target_sources(${PROJECT_NAME}-fb PRIVATE $) +target_sources(${PROJECT_NAME}-fb PRIVATE + $ +) +target_include_directories(${PROJECT_NAME}-fb PUBLIC + $ +) target_link_libraries(${PROJECT_NAME}-fb flatbuffers::flatbuffers gRPC::grpc++ ) -add_dependencies(${PROJECT_NAME}-fb GENERATE_fbschemas) +add_dependencies(${PROJECT_NAME}-fb GENERATE_fbservice)