find_package(Protobuf REQUIRED) set(proto_files cmix.proto) protobuf_generate_cpp(proto_sources proto_headers ${proto_files} ) add_library(cmix-protobuf ${proto_files} ${proto_headers} ${proto_sources} ) target_include_directories(cmix-protobuf PUBLIC ${PROTOBUF_INCLUDE_DIRS} PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ) target_link_libraries(cmix-protobuf ${PROTOBUF_LIBRARIES})