aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/libprotoc.cmake
blob: 107c1c526b2b0a96942784e14738f0fb0d6a57b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
set(libprotoc_files
  ${protobuf_source_dir}/src/google/protobuf/compiler/code_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_extension.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_file.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_helpers.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_map_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_field_base.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_helpers.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_map_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_context.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_doc_comment.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_file.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator_factory.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_helpers.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_lazy_message_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_name_resolver.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_service.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_shared_code_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field_lite.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_enum.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_enum_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_extension.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_file.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_helpers.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_map_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_extension.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_file.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/php/php_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.cc
  ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc
)

set(libprotoc_headers
  ${protobuf_source_dir}/src/google/protobuf/compiler/code_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/importer.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/package_info.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/parser.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_extension.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_file.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_helpers.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_map_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_options.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_unittest.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_doc_comment.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_field_base.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_helpers.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_map_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_names.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_options.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_primitive_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_reflection_class.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_context.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_doc_comment.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_file.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator_factory.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_helpers.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_lazy_message_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_lazy_message_field_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_names.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_name_resolver.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_options.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_service.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_shared_code_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field_lite.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_enum.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_enum_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_extension.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_file.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_helpers.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_map_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_params.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_primitive_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_extension.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_file.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_helpers.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_map_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_oneof.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/php/php_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.h
  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.h
)

set(js_well_known_types_sources
  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/any.js
  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/struct.js
  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/timestamp.js
)
add_executable(js_embed ${protobuf_source_dir}/src/google/protobuf/compiler/js/embed.cc)
add_custom_command(
  OUTPUT ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
  DEPENDS js_embed ${js_well_known_types_sources}
  COMMAND js_embed ${js_well_known_types_sources} > ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
)

add_library(libprotoc ${protobuf_SHARED_OR_STATIC}
  ${libprotoc_files} ${libprotoc_headers})
target_link_libraries(libprotoc libprotobuf)
if(MSVC AND protobuf_BUILD_SHARED_LIBS)
  target_compile_definitions(libprotoc
    PUBLIC  PROTOBUF_USE_DLLS
    PRIVATE LIBPROTOC_EXPORTS)
endif()
set_target_properties(libprotoc PROPERTIES
    COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
    OUTPUT_NAME ${LIB_PREFIX}protoc
    DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")