| OLD | NEW |
| (Empty) |
| 1 if (NOT EXISTS "${PROJECT_SOURCE_DIR}/../gmock/CMakeLists.txt") | |
| 2 message(FATAL_ERROR "Cannot find gmock directory.") | |
| 3 endif() | |
| 4 | |
| 5 include_directories( | |
| 6 ${protobuf_source_dir}/gmock | |
| 7 ${protobuf_source_dir}/gmock/gtest | |
| 8 ${protobuf_source_dir}/gmock/gtest/include | |
| 9 ${protobuf_source_dir}/gmock/include | |
| 10 ) | |
| 11 | |
| 12 add_library(gmock STATIC | |
| 13 ${protobuf_source_dir}/gmock/src/gmock-all.cc | |
| 14 ${protobuf_source_dir}/gmock/gtest/src/gtest-all.cc | |
| 15 ) | |
| 16 add_library(gmock_main STATIC ${protobuf_source_dir}/gmock/src/gmock_main.cc) | |
| 17 target_link_libraries(gmock_main gmock) | |
| 18 | |
| 19 set(lite_test_protos | |
| 20 google/protobuf/map_lite_unittest.proto | |
| 21 google/protobuf/unittest_import_lite.proto | |
| 22 google/protobuf/unittest_import_public_lite.proto | |
| 23 google/protobuf/unittest_lite.proto | |
| 24 ) | |
| 25 | |
| 26 set(tests_protos | |
| 27 google/protobuf/any_test.proto | |
| 28 google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto | |
| 29 google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto | |
| 30 google/protobuf/map_proto2_unittest.proto | |
| 31 google/protobuf/map_unittest.proto | |
| 32 google/protobuf/unittest.proto | |
| 33 google/protobuf/unittest_arena.proto | |
| 34 google/protobuf/unittest_custom_options.proto | |
| 35 google/protobuf/unittest_drop_unknown_fields.proto | |
| 36 google/protobuf/unittest_embed_optimize_for.proto | |
| 37 google/protobuf/unittest_empty.proto | |
| 38 google/protobuf/unittest_enormous_descriptor.proto | |
| 39 google/protobuf/unittest_import.proto | |
| 40 google/protobuf/unittest_import_public.proto | |
| 41 google/protobuf/unittest_lite_imports_nonlite.proto | |
| 42 google/protobuf/unittest_mset.proto | |
| 43 google/protobuf/unittest_no_arena.proto | |
| 44 google/protobuf/unittest_no_arena_import.proto | |
| 45 google/protobuf/unittest_no_field_presence.proto | |
| 46 google/protobuf/unittest_no_generic_services.proto | |
| 47 google/protobuf/unittest_optimize_for.proto | |
| 48 google/protobuf/unittest_preserve_unknown_enum.proto | |
| 49 google/protobuf/unittest_preserve_unknown_enum2.proto | |
| 50 google/protobuf/unittest_proto3_arena.proto | |
| 51 google/protobuf/unittest_well_known_types.proto | |
| 52 google/protobuf/util/internal/testdata/anys.proto | |
| 53 google/protobuf/util/internal/testdata/books.proto | |
| 54 google/protobuf/util/internal/testdata/default_value.proto | |
| 55 google/protobuf/util/internal/testdata/default_value_test.proto | |
| 56 google/protobuf/util/internal/testdata/field_mask.proto | |
| 57 google/protobuf/util/internal/testdata/maps.proto | |
| 58 google/protobuf/util/internal/testdata/struct.proto | |
| 59 google/protobuf/util/internal/testdata/timestamp_duration.proto | |
| 60 google/protobuf/util/json_format_proto3.proto | |
| 61 ) | |
| 62 | |
| 63 macro(compile_proto_file filename) | |
| 64 get_filename_component(dirname ${filename} PATH) | |
| 65 get_filename_component(basename ${filename} NAME_WE) | |
| 66 add_custom_command( | |
| 67 OUTPUT ${protobuf_source_dir}/src/${dirname}/${basename}.pb.cc | |
| 68 DEPENDS protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto | |
| 69 COMMAND protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto | |
| 70 --proto_path=${protobuf_source_dir}/src | |
| 71 --cpp_out=${protobuf_source_dir}/src | |
| 72 ) | |
| 73 endmacro(compile_proto_file) | |
| 74 | |
| 75 set(lite_test_proto_files) | |
| 76 foreach(proto_file ${lite_test_protos}) | |
| 77 compile_proto_file(${proto_file}) | |
| 78 string(REPLACE .proto .pb.cc pb_file ${proto_file}) | |
| 79 set(lite_test_proto_files ${lite_test_proto_files} | |
| 80 ${protobuf_source_dir}/src/${pb_file}) | |
| 81 endforeach(proto_file) | |
| 82 | |
| 83 set(tests_proto_files) | |
| 84 foreach(proto_file ${tests_protos}) | |
| 85 compile_proto_file(${proto_file}) | |
| 86 string(REPLACE .proto .pb.cc pb_file ${proto_file}) | |
| 87 set(tests_proto_files ${tests_proto_files} | |
| 88 ${protobuf_source_dir}/src/${pb_file}) | |
| 89 endforeach(proto_file) | |
| 90 | |
| 91 set(common_test_files | |
| 92 ${protobuf_source_dir}/src/google/protobuf/arena_test_util.cc | |
| 93 ${protobuf_source_dir}/src/google/protobuf/map_test_util.cc | |
| 94 ${protobuf_source_dir}/src/google/protobuf/test_util.cc | |
| 95 ${protobuf_source_dir}/src/google/protobuf/testing/file.cc | |
| 96 ${protobuf_source_dir}/src/google/protobuf/testing/googletest.cc | |
| 97 ) | |
| 98 | |
| 99 set(tests_files | |
| 100 ${protobuf_source_dir}/src/google/protobuf/any_test.cc | |
| 101 ${protobuf_source_dir}/src/google/protobuf/arena_unittest.cc | |
| 102 ${protobuf_source_dir}/src/google/protobuf/arenastring_unittest.cc | |
| 103 ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface_uni
ttest.cc | |
| 104 ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest
.cc | |
| 105 ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc | |
| 106 ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_unittest.cc | |
| 107 ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator_un
ittest.cc | |
| 108 ${protobuf_source_dir}/src/google/protobuf/compiler/importer_unittest.cc | |
| 109 ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_doc_comment_unit
test.cc | |
| 110 ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_plugin_unittest.
cc | |
| 111 ${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.cc | |
| 112 ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_help
ers_unittest.cc | |
| 113 ${protobuf_source_dir}/src/google/protobuf/compiler/parser_unittest.cc | |
| 114 ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_plugin_unitt
est.cc | |
| 115 ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator_unitte
st.cc | |
| 116 ${protobuf_source_dir}/src/google/protobuf/descriptor_database_unittest.cc | |
| 117 ${protobuf_source_dir}/src/google/protobuf/descriptor_unittest.cc | |
| 118 ${protobuf_source_dir}/src/google/protobuf/drop_unknown_fields_test.cc | |
| 119 ${protobuf_source_dir}/src/google/protobuf/dynamic_message_unittest.cc | |
| 120 ${protobuf_source_dir}/src/google/protobuf/extension_set_unittest.cc | |
| 121 ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection_unitte
st.cc | |
| 122 ${protobuf_source_dir}/src/google/protobuf/io/coded_stream_unittest.cc | |
| 123 ${protobuf_source_dir}/src/google/protobuf/io/printer_unittest.cc | |
| 124 ${protobuf_source_dir}/src/google/protobuf/io/tokenizer_unittest.cc | |
| 125 ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_unittest.cc | |
| 126 ${protobuf_source_dir}/src/google/protobuf/map_field_test.cc | |
| 127 ${protobuf_source_dir}/src/google/protobuf/map_test.cc | |
| 128 ${protobuf_source_dir}/src/google/protobuf/message_unittest.cc | |
| 129 ${protobuf_source_dir}/src/google/protobuf/no_field_presence_test.cc | |
| 130 ${protobuf_source_dir}/src/google/protobuf/preserve_unknown_enum_test.cc | |
| 131 ${protobuf_source_dir}/src/google/protobuf/proto3_arena_unittest.cc | |
| 132 ${protobuf_source_dir}/src/google/protobuf/reflection_ops_unittest.cc | |
| 133 ${protobuf_source_dir}/src/google/protobuf/repeated_field_reflection_unittest.
cc | |
| 134 ${protobuf_source_dir}/src/google/protobuf/repeated_field_unittest.cc | |
| 135 ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream_unittest.cc | |
| 136 ${protobuf_source_dir}/src/google/protobuf/stubs/common_unittest.cc | |
| 137 ${protobuf_source_dir}/src/google/protobuf/stubs/once_unittest.cc | |
| 138 ${protobuf_source_dir}/src/google/protobuf/stubs/status_test.cc | |
| 139 ${protobuf_source_dir}/src/google/protobuf/stubs/statusor_test.cc | |
| 140 ${protobuf_source_dir}/src/google/protobuf/stubs/stringpiece_unittest.cc | |
| 141 ${protobuf_source_dir}/src/google/protobuf/stubs/stringprintf_unittest.cc | |
| 142 ${protobuf_source_dir}/src/google/protobuf/stubs/structurally_valid_unittest.c
c | |
| 143 ${protobuf_source_dir}/src/google/protobuf/stubs/strutil_unittest.cc | |
| 144 ${protobuf_source_dir}/src/google/protobuf/stubs/template_util_unittest.cc | |
| 145 ${protobuf_source_dir}/src/google/protobuf/stubs/time_test.cc | |
| 146 ${protobuf_source_dir}/src/google/protobuf/stubs/type_traits_unittest.cc | |
| 147 ${protobuf_source_dir}/src/google/protobuf/text_format_unittest.cc | |
| 148 ${protobuf_source_dir}/src/google/protobuf/unknown_field_set_unittest.cc | |
| 149 ${protobuf_source_dir}/src/google/protobuf/util/field_comparator_test.cc | |
| 150 ${protobuf_source_dir}/src/google/protobuf/util/internal/default_value_objectw
riter_test.cc | |
| 151 ${protobuf_source_dir}/src/google/protobuf/util/internal/json_objectwriter_tes
t.cc | |
| 152 ${protobuf_source_dir}/src/google/protobuf/util/internal/json_stream_parser_te
st.cc | |
| 153 ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectsou
rce_test.cc | |
| 154 ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectwri
ter_test.cc | |
| 155 ${protobuf_source_dir}/src/google/protobuf/util/internal/type_info_test_helper
.cc | |
| 156 ${protobuf_source_dir}/src/google/protobuf/util/json_util_test.cc | |
| 157 ${protobuf_source_dir}/src/google/protobuf/util/type_resolver_util_test.cc | |
| 158 ${protobuf_source_dir}/src/google/protobuf/well_known_types_unittest.cc | |
| 159 ${protobuf_source_dir}/src/google/protobuf/wire_format_unittest.cc | |
| 160 ) | |
| 161 | |
| 162 add_executable(tests ${tests_files} ${common_test_files} ${tests_proto_files} ${
lite_test_proto_files}) | |
| 163 target_link_libraries(tests libprotoc libprotobuf gmock_main) | |
| 164 | |
| 165 set(test_plugin_files | |
| 166 ${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.cc | |
| 167 ${protobuf_source_dir}/src/google/protobuf/testing/file.cc | |
| 168 ${protobuf_source_dir}/src/google/protobuf/testing/file.h | |
| 169 ${protobuf_source_dir}/src/google/protobuf/compiler/test_plugin.cc | |
| 170 ) | |
| 171 | |
| 172 add_executable(test_plugin ${test_plugin_files}) | |
| 173 target_link_libraries(test_plugin libprotoc libprotobuf gmock) | |
| 174 | |
| 175 set(lite_test_files | |
| 176 ${protobuf_source_dir}/src/google/protobuf/arena_test_util.cc | |
| 177 ${protobuf_source_dir}/src/google/protobuf/lite_unittest.cc | |
| 178 ${protobuf_source_dir}/src/google/protobuf/map_lite_test_util.cc | |
| 179 ${protobuf_source_dir}/src/google/protobuf/test_util_lite.cc | |
| 180 ) | |
| 181 add_executable(lite-test ${lite_test_files} ${lite_test_proto_files}) | |
| 182 target_link_libraries(lite-test libprotobuf-lite) | |
| OLD | NEW |