1 2add_custom_command( 3 OUTPUT ${protobuf_SOURCE_DIR}/conformance/conformance.pb.cc 4 DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_SOURCE_DIR}/conformance/conformance.proto 5 COMMAND ${protobuf_PROTOC_EXE} ${protobuf_SOURCE_DIR}/conformance/conformance.proto 6 --proto_path=${protobuf_SOURCE_DIR}/conformance 7 --cpp_out=${protobuf_SOURCE_DIR}/conformance 8) 9 10add_custom_command( 11 OUTPUT ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto3.pb.cc 12 ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto2.pb.cc 13 DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto3.proto 14 ${protobuf_PROTOC_EXE} ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto2.proto 15 COMMAND ${protobuf_PROTOC_EXE} ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto3.proto 16 ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto2.proto 17 --proto_path=${protobuf_SOURCE_DIR}/src 18 --cpp_out=${protobuf_SOURCE_DIR}/src 19) 20 21add_executable(conformance_test_runner 22 ${protobuf_SOURCE_DIR}/conformance/binary_json_conformance_suite.cc 23 ${protobuf_SOURCE_DIR}/conformance/binary_json_conformance_suite.h 24 ${protobuf_SOURCE_DIR}/conformance/conformance.pb.cc 25 ${protobuf_SOURCE_DIR}/conformance/conformance_test.cc 26 ${protobuf_SOURCE_DIR}/conformance/conformance_test_runner.cc 27 ${protobuf_SOURCE_DIR}/conformance/third_party/jsoncpp/json.h 28 ${protobuf_SOURCE_DIR}/conformance/third_party/jsoncpp/jsoncpp.cpp 29 ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto2.pb.cc 30 ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto3.pb.cc 31) 32 33add_executable(conformance_cpp 34 ${protobuf_SOURCE_DIR}/conformance/conformance.pb.cc 35 ${protobuf_SOURCE_DIR}/conformance/conformance_cpp.cc 36 ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto2.pb.cc 37 ${protobuf_SOURCE_DIR}/src/google/protobuf/test_messages_proto3.pb.cc 38) 39 40target_include_directories( 41 conformance_test_runner 42 PUBLIC ${protobuf_SOURCE_DIR}/conformance) 43 44target_include_directories( 45 conformance_cpp 46 PUBLIC ${protobuf_SOURCE_DIR}/conformance) 47 48target_link_libraries(conformance_test_runner libprotobuf) 49target_link_libraries(conformance_cpp libprotobuf) 50