通过foreach遍历处理所有proto文件
file(GLOB ALL_PROTO_FILES ${PROTO_FILE_PATH}/*.proto)
foreach(proto_file ${ALL_PROTO_FILES})
execute_process(
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --proto_path=${PROTO_FILE_PATH} --cpp_out=${PROTO_OUTPUT_PATH} ${proto_file}
WORKING_DIRECTORY ${PROTO_FILE_PATH}
)
endforeach(proto_file ${})
PROTO_FILE_PATH变量:PROTO文件路径
PROTOBUF_PROTOC_EXECUTABLE变量:protoc可执行文件路径