diff --git a/src/example/CMakeLists.txt b/src/example/CMakeLists.txt index d7e38cefa..6405c3496 100644 --- a/src/example/CMakeLists.txt +++ b/src/example/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/examples) # protobuf_generate_struct_pb 函数 set(struct_pb_plugin_DIRS ${CMAKE_SOURCE_DIR}/src/protoc-plugin) # struct_pb_plugin_DIRS 将指定 proto_to_struct.proto,struct_pb.cmake等目录 -set(Protobuf_IMPORT_DIRS ${CMAKE_SOURCE_DIR} ${struct_pb_plugin_DIRS} ${CMAKE_CURRENT_LIST_DIR}) # 设置protoc --proto_path参数 +set(Protobuf_IMPORT_DIRS ${struct_pb_plugin_DIRS} ${CMAKE_CURRENT_LIST_DIR}) # 设置protoc --proto_path参数 include(${struct_pb_plugin_DIRS}/cmake/struct_pb.cmake) find_package(PCL REQUIRED COMPONENTS common io) @@ -31,7 +31,6 @@ protobuf_generate_python(PROTO_PYTHON_SRCS protobuf_generate_struct_pb(PROTO_STRUCT_SRCS PROTO_STRUCT_HDRS ${PROTO_FILES} OPTION "namespace=zhito.inner_struct,converter_namespace=zhito.converter" -# PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/src/example/message/CMakeLists.txt b/src/example/message/CMakeLists.txt index e6fe8d014..e201c4c50 100644 --- a/src/example/message/CMakeLists.txt +++ b/src/example/message/CMakeLists.txt @@ -4,23 +4,18 @@ file(GLOB PROTO_FILES "*.proto") # generate .pb.cc .pb.h protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES} - # IMPORT_DIRS ${CMAKE_SOURCE_DIR} ) protobuf_generate_python(PROTO_PYTHON_SRCS ${PROTO_FILES} - # IMPORT_DIRS ${CMAKE_SOURCE_DIR} ) # 删除点云,图片proto记录文件 list(FILTER PROTO_FILES EXCLUDE REGEX "pointcloud\\.proto$|image\\.proto$") -# message(status "-------${PROTO_FILES}-------") - protobuf_generate_struct_pb(PROTO_STRUCT_SRCS PROTO_STRUCT_HDRS ${PROTO_FILES} OPTION "namespace=zhito.inner_struct,converter_namespace=zhito.converter" -# PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR} ) add_library($ENV{proto_message} OBJECT @@ -30,7 +25,7 @@ add_library($ENV{proto_message} OBJECT ${PROTO_HDRS} ${PROTO_STRUCT_SRCS} ${PROTO_STRUCT_HDRS} - # ${PROTO_PYTHON_SRCS} + ${PROTO_PYTHON_SRCS} ) target_link_libraries($ENV{proto_message} protobuf::libprotobuf