CMake 下使用 protobuf protobuf是google开发的一个序列化和反序列化的库,通过.proto文件定义文件格式,序列化后的数据是binary的,可以在多语言上使用.一般情况下,若客户端和服务端都是自己做的,用protobuf作为通讯协议,无疑是一个不错的选择. 个人一般喜欢用CMake来管理c++工程.那么,cmake下使用protobuf对个人...
├── CMakeLists.txt ├── c_proto.cc └── c_proto.hh 其中foo.proto文件如下: foo.proto 1 2 3 4 message foo_msg { optional string name = 1; } bar.proto文件如下: bar.proto 1 2 3 4 5 6 7 import "common/foo/foo.proto"; message bar_msg { optional foo_msg foo = 1;...
CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning. MACOSX_RPATH is not specified for the following targets: cjson iniparser ...