blob: 41829e06d89d7370e99d77dac766805ed3810109 (
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
|
# raptor/src/CMakeLists.txt
#
# Original listfile by Daniel Richard G. <skunk@iSKUNK.ORG>
# This file is in the public domain.
#
# Changes 01/20/15 J Kyle Medley
#
IF(RAPTOR_PARSER_RDFA)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa)
ENDIF(RAPTOR_PARSER_RDFA)
# ** Parser sources **
# XML parser enabled
IF(RAPTOR_PARSER_RDFXML)
SET(raptor_parser_rdfxml_sources raptor_rdfxml.c)
SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
ENDIF(RAPTOR_PARSER_RDFXML)
# N triples parser enabled
IF(RAPTOR_PARSER_NTRIPLES OR RAPTOR_PARSER_NQUADS)
SET(raptor_parser_ntriples_nquads_sources ntriples_parse.c raptor_ntriples.c)
ENDIF(RAPTOR_PARSER_NTRIPLES OR RAPTOR_PARSER_NQUADS)
# Turtle parser enabled
IF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG)
SET(raptor_parser_turtle_trig_sources
# turtle_common.h
${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.c
# turtle_lexer.h
${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c
# turtle_parser.h
)
# Generate the turtle parser
ADD_CUSTOM_TARGET(turtle_tables_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.tab.c)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.tab.c
COMMAND ${BISON_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c ${CMAKE_CURRENT_SOURCE_DIR}/turtle_parser.y
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/turtle_parser.y)
ADD_CUSTOM_TARGET(turtle_parser_tgt DEPENDS turtle_tables_tgt ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.h)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-bison.pl ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c
DEPENDS turtle_tables_tgt)
# Generate the turtle lexer
ADD_CUSTOM_TARGET(turtle_flex_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t
COMMAND ${FLEX_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t ${CMAKE_CURRENT_SOURCE_DIR}/turtle_lexer.l
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/turtle_lexer.l)
ADD_CUSTOM_TARGET(turtle_lexer_tgt DEPENDS turtle_flex_tgt)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.c
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-flex.pl ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t > ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.c
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-flex.pl ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.h > ${CMAKE_CURRENT_BINARY_DIR}/t
COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/t ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.h
DEPENDS turtle_flex_tgt)
ENDIF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG)
# RSS feed parser enabled
IF(RAPTOR_PARSER_RSS OR RAPTOR_SERIALIZER_RSS_1_0)
SET(raptor_rss_common_sources raptor_rss_common.c raptor_rss.h)
ENDIF(RAPTOR_PARSER_RSS OR RAPTOR_SERIALIZER_RSS_1_0)
IF(RAPTOR_PARSER_RSS)
SET(raptor_parser_rss_sources raptor_rss.c)
SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
ENDIF(RAPTOR_PARSER_RSS)
# GRDDL parser enabled
IF(RAPTOR_PARSER_GRDDL)
SET(raptor_parser_grddl_sources raptor_grddl.c)
SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
SET(raptor_libxslt_libs ${LIBXSLT_LIBRARIES})
ENDIF(RAPTOR_PARSER_GRDDL)
# Guess which parser to use based on context
IF(RAPTOR_PARSER_GUESS)
SET(raptor_parser_guess_sources raptor_guess.c)
ENDIF(RAPTOR_PARSER_GUESS)
# RDFA parser enabled
IF(RAPTOR_PARSER_RDFA)
SET(raptor_parser_rdfa_sources raptor_librdfa.c)
ENDIF(RAPTOR_PARSER_RDFA)
# JSON parser enabled
IF(RAPTOR_PARSER_JSON)
SET(raptor_parser_json_sources raptor_json.c)
ENDIF(RAPTOR_PARSER_JSON)
# ** Serializers **
IF(RAPTOR_SERIALIZER_RDFXML)
SET(raptor_serializer_rdfxml_sources raptor_serialize_rdfxml.c)
ENDIF(RAPTOR_SERIALIZER_RDFXML)
IF(RAPTOR_SERIALIZER_NTRIPLES OR RAPTOR_SERIALIZER_NQUADS)
SET(raptor_serializer_ntriples_nquads_sources raptor_serialize_ntriples.c)
ENDIF(RAPTOR_SERIALIZER_NTRIPLES OR RAPTOR_SERIALIZER_NQUADS)
IF(RAPTOR_SERIALIZER_RDFXML_ABBREV OR RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR)
SET(raptor_serializer_abbrev_sources raptor_abbrev.c)
ENDIF(RAPTOR_SERIALIZER_RDFXML_ABBREV OR RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR)
IF(RAPTOR_SERIALIZER_RDFXML_ABBREV)
SET(raptor_serializer_rdfxml_abbrev_sources raptor_serialize_rdfxmla.c)
ENDIF(RAPTOR_SERIALIZER_RDFXML_ABBREV)
IF(RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR)
SET(raptor_serializer_turtle_sources raptor_serialize_turtle.c)
ENDIF(RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR)
IF(RAPTOR_SERIALIZER_RSS_1_0)
SET(raptor_serializer_rss_1_0_sources raptor_serialize_rss.c)
ENDIF(RAPTOR_SERIALIZER_RSS_1_0)
IF(RAPTOR_SERIALIZER_DOT)
SET(raptor_serializer_dot_sources raptor_serialize_dot.c)
ENDIF(RAPTOR_SERIALIZER_DOT)
IF(RAPTOR_SERIALIZER_HTML)
SET(raptor_serializer_html_sources raptor_serialize_html.c)
ENDIF(RAPTOR_SERIALIZER_HTML)
IF(RAPTOR_SERIALIZER_JSON)
SET(raptor_serializer_json_sources raptor_serialize_json.c)
SET(raptor_yajl_libs ${YAJL_LIBRARIES})
ENDIF(RAPTOR_SERIALIZER_JSON)
IF(RAPTOR_WWW STREQUAL "curl")
SET(raptor_www_sources raptor_www_curl.c)
SET(raptor_www_libs ${CURL_LIBRARIES})
ELSEIF(RAPTOR_WWW STREQUAL "fetch")
SET(raptor_www_sources raptor_www_libfetch.c)
#SET(raptor_www_libs ${FETCH_LIBRARIES})
ELSEIF(RAPTOR_WWW STREQUAL "xml")
SET(raptor_www_sources raptor_www_libxml.c)
SET(raptor_www_libs ${LIBXML2_LIBRARIES})
ENDIF(RAPTOR_WWW STREQUAL "curl")
IF(RAPTOR_XML STREQUAL "libxml")
SET(raptor_libxml_sources raptor_libxml.c)
SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
ENDIF(RAPTOR_XML STREQUAL "libxml")
IF(RAPTOR_PARSER_RDFA)
SET(raptor_librdfa_sources
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/context.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/curie.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/iri.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/language.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/lists.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/namespace.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/rdfa.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/rdfa_utils.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/strtok_r.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/subject.c
${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/triple.c
# ${CMAKE_SOURCE_DIR}/librdfa/rdfa.h
# ${CMAKE_SOURCE_DIR}/librdfa/rdfa_utils.h
# ${CMAKE_SOURCE_DIR}/librdfa/strtok_r.h
)
ENDIF(RAPTOR_PARSER_RDFA)
IF(NOT HAVE_STRCASECMP AND NOT HAVE_STRICMP)
SET(raptor_strcasecmp_sources strcasecmp.c)
ENDIF(NOT HAVE_STRCASECMP AND NOT HAVE_STRICMP)
IF(RAPTOR_PARSEDATE)
SET(raptor_parsedate_sources ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c)
# Generate the date/time parser
ADD_CUSTOM_TARGET(parsedate_tables_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/parsedate.tab.c)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parsedate.tab.c
COMMAND ${BISON_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c ${CMAKE_CURRENT_SOURCE_DIR}/parsedate.y
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parsedate.y)
ADD_CUSTOM_TARGET(parsedate_tgt DEPENDS parsedate_tables_tgt ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c ${CMAKE_CURRENT_BINARY_DIR}/parsedate.h)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-bison.pl ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c
DEPENDS parsedate_tables_tgt)
ENDIF(RAPTOR_PARSEDATE)
IF(BUILD_SHARED_LIBS)
SET(LIB_TYPE SHARED)
ELSE(BUILD_SHARED_LIBS)
SET(LIB_TYPE STATIC)
ENDIF(BUILD_SHARED_LIBS)
ADD_LIBRARY(raptor2 ${LIB_TYPE}
raptor_avltree.c
raptor_concepts.c
raptor_escaped.c
raptor_general.c
raptor_iostream.c
raptor_json_writer.c
raptor_locator.c
raptor_log.c
raptor_memstr.c
raptor_namespace.c
raptor_option.c
raptor_parse.c
raptor_qname.c
raptor_rfc2396.c
raptor_sax2.c
raptor_sequence.c
raptor_serialize.c
raptor_set.c
raptor_statement.c
raptor_stringbuffer.c
raptor_syntax_description.c
raptor_term.c
raptor_turtle_writer.c
raptor_unicode.c
raptor_uri.c
raptor_www.c
raptor_xml.c
raptor_xml_writer.c
snprintf.c
sort_r.c
turtle_common.c
${raptor_parser_rdfxml_sources}
${raptor_parser_ntriples_nquads_sources}
${raptor_parser_turtle_trig_sources}
${raptor_rss_common_sources}
${raptor_parser_rss_sources}
${raptor_parser_grddl_sources}
${raptor_parser_guess_sources}
${raptor_parser_rdfa_sources}
${raptor_parser_json_sources}
${raptor_serializer_rdfxml_sources}
${raptor_serializer_ntriples_nquads_sources}
${raptor_serializer_abbrev_sources}
${raptor_serializer_rdfxml_abbrev_sources}
${raptor_serializer_turtle_sources}
${raptor_serializer_rss_1_0_sources}
${raptor_serializer_dot_sources}
${raptor_serializer_html_sources}
${raptor_serializer_json_sources}
${raptor_www_sources}
${raptor_libxml_sources}
${raptor_librdfa_sources}
${raptor_strcasecmp_sources}
${raptor_parsedate_sources}
)
IF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG)
add_dependencies(raptor2 turtle_parser_tgt turtle_lexer_tgt)
ENDIF()
IF(RAPTOR_PARSEDATE)
add_dependencies(raptor2 parsedate_tgt)
ENDIF()
TARGET_LINK_LIBRARIES(raptor2
${raptor_libxslt_libs}
${raptor_libxml_libs}
${raptor_yajl_libs}
${raptor_www_libs}
)
SET_TARGET_PROPERTIES(
raptor2
PROPERTIES
COMPILE_DEFINITIONS "LIBRDFA_IN_RAPTOR;RAPTOR_INTERNAL;${LIBXML2_DEFINITIONS};${LIBXSLT_DEFINITIONS}"
)
ADD_EXECUTABLE(turtle_lexer_test turtle_lexer.c)
TARGET_LINK_LIBRARIES(turtle_lexer_test raptor2)
IF(NOT WIN32 OR NOT BUILD_SHARED_LIBS)
# This currently cannot be built on Windows with DLL linkage
ADD_EXECUTABLE(turtle_parser_test turtle_parser.c)
TARGET_LINK_LIBRARIES(turtle_parser_test raptor2)
SET_TARGET_PROPERTIES(
turtle_parser_test
PROPERTIES
COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE"
)
ENDIF(NOT WIN32 OR NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE(raptor_parse_test raptor_parse.c)
TARGET_LINK_LIBRARIES(raptor_parse_test raptor2)
ADD_TEST(raptor_parse_test raptor_parse_test)
ADD_EXECUTABLE(raptor_rfc2396_test raptor_rfc2396.c)
TARGET_LINK_LIBRARIES(raptor_rfc2396_test raptor2)
ADD_TEST(raptor_rfc2396_test raptor_rfc2396_test)
ADD_EXECUTABLE(raptor_uri_test raptor_uri.c)
TARGET_LINK_LIBRARIES(raptor_uri_test raptor2)
ADD_TEST(raptor_uri_test raptor_uri_test)
ADD_EXECUTABLE(raptor_namespace_test raptor_namespace.c)
TARGET_LINK_LIBRARIES(raptor_namespace_test raptor2)
ADD_TEST(raptor_namespace_test raptor_namespace_test)
ADD_EXECUTABLE(strcasecmp_test strcasecmp.c)
TARGET_LINK_LIBRARIES(strcasecmp_test raptor2)
ADD_TEST(strcasecmp_test strcasecmp_test)
ADD_EXECUTABLE(raptor_www_test raptor_www_test.c)
TARGET_LINK_LIBRARIES(raptor_www_test raptor2)
ADD_TEST(raptor_www_test raptor_www_test)
ADD_EXECUTABLE(raptor_sequence_test raptor_sequence.c)
TARGET_LINK_LIBRARIES(raptor_sequence_test raptor2)
ADD_TEST(raptor_sequence_test raptor_sequence_test)
ADD_EXECUTABLE(raptor_stringbuffer_test raptor_stringbuffer.c)
TARGET_LINK_LIBRARIES(raptor_stringbuffer_test raptor2)
ADD_TEST(raptor_stringbuffer_test raptor_stringbuffer_test)
ADD_EXECUTABLE(raptor_iostream_test raptor_iostream.c)
TARGET_LINK_LIBRARIES(raptor_iostream_test raptor2)
ADD_TEST(raptor_iostream_test raptor_iostream_test)
ADD_EXECUTABLE(raptor_xml_writer_test raptor_xml_writer.c)
TARGET_LINK_LIBRARIES(raptor_xml_writer_test raptor2)
ADD_TEST(raptor_xml_writer_test raptor_xml_writer_test)
ADD_EXECUTABLE(raptor_turtle_writer_test raptor_turtle_writer.c)
TARGET_LINK_LIBRARIES(raptor_turtle_writer_test raptor2)
ADD_TEST(raptor_turtle_writer_test raptor_turtle_writer_test)
ADD_EXECUTABLE(raptor_avltree_test raptor_avltree.c)
TARGET_LINK_LIBRARIES(raptor_avltree_test raptor2)
ADD_TEST(raptor_avltree_test raptor_avltree_test)
ADD_EXECUTABLE(raptor_term_test raptor_term.c)
TARGET_LINK_LIBRARIES(raptor_term_test raptor2)
ADD_TEST(raptor_term_test raptor_term_test)
ADD_EXECUTABLE(raptor_permute_test raptor_permute_test.c)
TARGET_LINK_LIBRARIES(raptor_permute_test raptor2)
ADD_TEST(raptor_permute_test raptor_permute_test)
ADD_EXECUTABLE(raptor_snprintf_test snprintf.c)
TARGET_LINK_LIBRARIES(raptor_snprintf_test raptor2)
ADD_TEST(raptor_snprintf_test raptor_snprintf_test)
ADD_EXECUTABLE(raptor_sort_r_test sort_r.c)
TARGET_LINK_LIBRARIES(raptor_sort_r_test raptor2)
ADD_TEST(raptor_sort_r_test raptor_sort_r_test)
SET_TARGET_PROPERTIES(
turtle_lexer_test
#turtle_parser_test
raptor_parse_test
raptor_rfc2396_test
raptor_uri_test
raptor_namespace_test
strcasecmp_test
raptor_www_test
raptor_sequence_test
raptor_stringbuffer_test
raptor_iostream_test
raptor_xml_writer_test
raptor_turtle_writer_test
raptor_avltree_test
raptor_term_test
raptor_permute_test
raptor_snprintf_test
raptor_sort_r_test
PROPERTIES
COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE"
)
IF(RAPTOR_PARSER_RDFXML)
ADD_EXECUTABLE(raptor_set_test raptor_set.c)
TARGET_LINK_LIBRARIES(raptor_set_test raptor2)
ADD_TEST(raptor_set_test raptor_set_test)
ADD_EXECUTABLE(raptor_xml_test raptor_xml.c)
TARGET_LINK_LIBRARIES(raptor_xml_test raptor2)
ADD_TEST(raptor_xml_test raptor_xml_test)
SET_TARGET_PROPERTIES(
raptor_set_test
raptor_xml_test
PROPERTIES
COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE"
)
ENDIF(RAPTOR_PARSER_RDFXML)
# Generate pkg-config metadata file
#
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/raptor2.pc
"prefix=${CMAKE_INSTALL_PREFIX}
exec_prefix=\${prefix}
libdir=${CMAKE_INSTALL_FULL_LIBDIR}
includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}/raptor2
Name: Raptor RDF Parsing Library
Description: RDF Parser Toolkit Library
Version: ${VERSION}
Libs: -L\${libdir} -lraptor2
Libs.private: ${raptor_libxslt_libs} ${raptor_libxml_libs}
Cflags: -I\${includedir}
")
INSTALL(FILES
raptor.h
${CMAKE_CURRENT_BINARY_DIR}/raptor2.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/raptor2
)
INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/raptor2.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
INSTALL(
TARGETS raptor2
EXPORT Raptor2Config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
INSTALL(EXPORT Raptor2Config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
# end raptor/src/CMakeLists.txt
|