Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

CMake build framework for Raptor - win32

This commit is based on the email with patch that Daniel Richard G.
sent to redland-dev on 5th July 2012

    http://lists.librdf.org/pipermail/redland-dev/2012-July/002502.html

I lightly edited the email to fit into 80 chars and make more it
markdowny and turn it into win32/README.md

-- Dave Beckett
  • Loading branch information...
commit a9bd433c7fbee09beb71f14f7fb0b49e6466a3dc 1 parent 97198ca
authored dajobe committed
353  CMakeLists.txt
... ...
@@ -0,0 +1,353 @@
  1
+# raptor/CMakeLists.txt
  2
+#
  3
+# This file allows building Raptor2 with the CMake configuration tool.
  4
+# Download CMake in source or binary form from http://www.cmake.org/
  5
+#
  6
+# Original listfile by Daniel Richard G. <skunk@iSKUNK.ORG>
  7
+# This file is in the public domain.
  8
+#
  9
+
  10
+SET(RAPTOR_VERSION_MAJOR	2)
  11
+SET(RAPTOR_VERSION_MINOR	0)
  12
+SET(RAPTOR_VERSION_RELEASE	9)
  13
+SET(RAPTOR_MIN_VERSION_DECIMAL	20000)
  14
+
  15
+SET(VERSION "${RAPTOR_VERSION_MAJOR}.${RAPTOR_VERSION_MINOR}.${RAPTOR_VERSION_RELEASE}")
  16
+MATH(EXPR RAPTOR_VERSION_DECIMAL "${RAPTOR_VERSION_MAJOR} * 10000 + ${RAPTOR_VERSION_MINOR} * 100 + ${RAPTOR_VERSION_RELEASE}")
  17
+
  18
+PROJECT(Raptor2 C)
  19
+
  20
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
  21
+
  22
+################################################################
  23
+
  24
+# Third-party libraries
  25
+
  26
+FIND_PACKAGE(CURL)
  27
+FIND_PACKAGE(LibXml2)
  28
+FIND_PACKAGE(LibXslt)
  29
+#FIND_PACKAGE(YAJL)
  30
+
  31
+INCLUDE_DIRECTORIES(
  32
+	${CURL_INCLUDE_DIRS}
  33
+	${EXPAT_INCLUDE_DIRS}
  34
+	${LIBXML2_INCLUDE_DIR}
  35
+	${LIBXSLT_INCLUDE_DIR}
  36
+)
  37
+
  38
+################################################################
  39
+
  40
+# Configuration checks
  41
+
  42
+INCLUDE(CheckIncludeFile)
  43
+INCLUDE(CheckIncludeFiles)
  44
+INCLUDE(CheckFunctionExists)
  45
+INCLUDE(CheckTypeSize)
  46
+INCLUDE(CheckStructHasMember)
  47
+INCLUDE(CheckCSourceCompiles)
  48
+
  49
+CHECK_INCLUDE_FILE(errno.h	HAVE_ERRNO_H)
  50
+CHECK_INCLUDE_FILE(fcntl.h	HAVE_FCNTL_H)
  51
+CHECK_INCLUDE_FILE(getopt.h	HAVE_GETOPT_H)
  52
+CHECK_INCLUDE_FILE(limits.h	HAVE_LIMITS_H)
  53
+CHECK_INCLUDE_FILE(math.h	HAVE_MATH_H)
  54
+CHECK_INCLUDE_FILE(setjmp.h	HAVE_SETJMP_H)
  55
+CHECK_INCLUDE_FILE(stddef.h	HAVE_STDDEF_H)
  56
+CHECK_INCLUDE_FILE(stdlib.h	HAVE_STDLIB_H)
  57
+CHECK_INCLUDE_FILE(string.h	HAVE_STRING_H)
  58
+CHECK_INCLUDE_FILE(unistd.h	HAVE_UNISTD_H)
  59
+CHECK_INCLUDE_FILE(sys/param.h	HAVE_SYS_PARAM_H)
  60
+CHECK_INCLUDE_FILE(sys/stat.h	HAVE_SYS_STAT_H)
  61
+CHECK_INCLUDE_FILE(sys/stat.h	HAVE_SYS_STAT_H)
  62
+CHECK_INCLUDE_FILE(sys/time.h	HAVE_SYS_TIME_H)
  63
+
  64
+CHECK_INCLUDE_FILES("sys/time.h;time.h" TIME_WITH_SYS_TIME)
  65
+
  66
+CHECK_FUNCTION_EXISTS(access		HAVE_ACCESS)
  67
+CHECK_FUNCTION_EXISTS(_access		HAVE__ACCESS)
  68
+CHECK_FUNCTION_EXISTS(getopt		HAVE_GETOPT)
  69
+CHECK_FUNCTION_EXISTS(getopt_long	HAVE_GETOPT_LONG)
  70
+CHECK_FUNCTION_EXISTS(gettimeofday	HAVE_GETTIMEOFDAY)
  71
+CHECK_FUNCTION_EXISTS(isascii		HAVE_ISASCII)
  72
+CHECK_FUNCTION_EXISTS(setjmp		HAVE_SETJMP)
  73
+CHECK_FUNCTION_EXISTS(snprintf		HAVE_SNPRINTF)
  74
+CHECK_FUNCTION_EXISTS(_snprintf		HAVE__SNPRINTF)
  75
+CHECK_FUNCTION_EXISTS(stat		HAVE_STAT)
  76
+CHECK_FUNCTION_EXISTS(strcasecmp	HAVE_STRCASECMP)
  77
+CHECK_FUNCTION_EXISTS(stricmp		HAVE_STRICMP)
  78
+CHECK_FUNCTION_EXISTS(_stricmp		HAVE__STRICMP)
  79
+CHECK_FUNCTION_EXISTS(strtok_r		HAVE_STRTOK_R)
  80
+CHECK_FUNCTION_EXISTS(vasprintf		HAVE_VASPRINTF)
  81
+CHECK_FUNCTION_EXISTS(vsnprintf		HAVE_VSNPRINTF)
  82
+CHECK_FUNCTION_EXISTS(_vsnprintf	HAVE__VSNPRINTF)
  83
+
  84
+CHECK_TYPE_SIZE("unsigned char"		SIZEOF_UNSIGNED_CHAR)
  85
+CHECK_TYPE_SIZE("unsigned short"	SIZEOF_UNSIGNED_SHORT)
  86
+CHECK_TYPE_SIZE("unsigned int"		SIZEOF_UNSIGNED_INT)
  87
+CHECK_TYPE_SIZE("unsigned long"		SIZEOF_UNSIGNED_LONG)
  88
+CHECK_TYPE_SIZE("unsigned long long"	SIZEOF_UNSIGNED_LONG_LONG)
  89
+
  90
+IF(LIBXML2_FOUND)
  91
+
  92
+	SET(CMAKE_REQUIRED_INCLUDES  ${LIBXML2_INCLUDE_DIR})
  93
+	SET(CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBRARIES})
  94
+
  95
+	CHECK_FUNCTION_EXISTS(xmlCtxtUseOptions     HAVE_XMLCTXTUSEOPTIONS)
  96
+	CHECK_FUNCTION_EXISTS(xmlSAX2InternalSubset HAVE_XMLSAX2INTERNALSUBSET)
  97
+
  98
+	CHECK_STRUCT_HAS_MEMBER(
  99
+		xmlEntity
  100
+		name_length
  101
+		libxml/parser.h
  102
+		RAPTOR_LIBXML_ENTITY_NAME_LENGTH
  103
+	)
  104
+
  105
+	CHECK_STRUCT_HAS_MEMBER(
  106
+		xmlEntity
  107
+		etype
  108
+		libxml/parser.h
  109
+		RAPTOR_LIBXML_ENTITY_ETYPE
  110
+	)
  111
+
  112
+	CHECK_STRUCT_HAS_MEMBER(
  113
+		xmlSAXHandler
  114
+		initialized
  115
+		libxml/parser.h
  116
+		RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED
  117
+	)
  118
+
  119
+	CHECK_STRUCT_HAS_MEMBER(
  120
+		xmlSAXHandler
  121
+		externalSubset
  122
+		libxml/parser.h
  123
+		RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET
  124
+	)
  125
+
  126
+	CHECK_C_SOURCE_COMPILES("
  127
+#include <libxml/parser.h>
  128
+int main(void){ xmlParserOption foo; foo = XML_PARSE_NONET; return 0; }"
  129
+		RAPTOR_LIBXML_XML_PARSE_NONET
  130
+	)
  131
+
  132
+	CHECK_C_SOURCE_COMPILES("
  133
+#include <libxml/HTMLparser.h>
  134
+int main(void){ htmlParserOption foo; foo = HTML_PARSE_NONET; return 0; }"
  135
+		RAPTOR_LIBXML_HTML_PARSE_NONET
  136
+	)
  137
+
  138
+	SET(CMAKE_REQUIRED_INCLUDES)
  139
+	SET(CMAKE_REQUIRED_LIBRARIES)
  140
+
  141
+ENDIF(LIBXML2_FOUND)
  142
+
  143
+################################################################
  144
+
  145
+# User-configurable options
  146
+#
  147
+# (Note: The CMake GUI displays these in alphabetical order, regardless of
  148
+# the order we use here)
  149
+
  150
+SET(BUILD_SHARED_LIBS OFF CACHE BOOL
  151
+	"Build shared libraries instead of static ones.")
  152
+
  153
+IF(BUILD_SHARED_LIBS)
  154
+	SET(RAPTOR_STATIC FALSE)
  155
+ELSE(BUILD_SHARED_LIBS)
  156
+	SET(RAPTOR_STATIC TRUE)
  157
+ENDIF(BUILD_SHARED_LIBS)
  158
+
  159
+SET(RAPTOR_XML_INIT none)
  160
+IF(LIBXML2_FOUND)
  161
+	SET(RAPTOR_XML_INIT libxml)
  162
+ENDIF(LIBXML2_FOUND)
  163
+
  164
+SET(RAPTOR_XML ${RAPTOR_XML_INIT} CACHE STRING
  165
+	"Which XML library to use (any of \"libxml\", \"none\").")
  166
+
  167
+SET(RAPTOR_XML_DEFINE RAPTOR_XML_NONE)
  168
+IF(RAPTOR_XML STREQUAL "libxml")
  169
+	SET(RAPTOR_XML_DEFINE RAPTOR_XML_LIBXML)
  170
+ENDIF(RAPTOR_XML STREQUAL "libxml")
  171
+
  172
+SET(RAPTOR_WWW_INIT none)
  173
+IF(LIBXML2_FOUND)
  174
+	SET(RAPTOR_WWW_INIT xml)
  175
+ENDIF(LIBXML2_FOUND)
  176
+IF(CURL_FOUND)
  177
+	SET(RAPTOR_WWW_INIT curl)
  178
+ENDIF(CURL_FOUND)
  179
+
  180
+SET(RAPTOR_WWW ${RAPTOR_WWW_INIT} CACHE STRING
  181
+	"Which WWW library to use (any of \"curl\", \"xml\", \"none\").")
  182
+
  183
+SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_NONE)
  184
+IF(RAPTOR_WWW STREQUAL "curl")
  185
+	SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_LIBCURL)
  186
+ELSEIF(RAPTOR_WWW STREQUAL "xml")
  187
+	SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_LIBXML)
  188
+ENDIF(RAPTOR_WWW STREQUAL "curl")
  189
+
  190
+SET(RAPTOR_XML_1_1 FALSE CACHE BOOL
  191
+	"Use XML version 1.1 name checking.")
  192
+
  193
+SET(HAVE_RAPTOR_PARSE_DATE 1)
  194
+SET(RAPTOR_PARSEDATE 1)
  195
+
  196
+SET(RAPTOR_PARSER_RDFXML_INIT FALSE)
  197
+IF(LIBXML2_FOUND)
  198
+	SET(RAPTOR_PARSER_RDFXML_INIT TRUE)
  199
+ENDIF(LIBXML2_FOUND)
  200
+
  201
+SET(RAPTOR_PARSER_GRDDL_INIT FALSE)
  202
+IF(LIBXML2_FOUND AND LIBXSLT_FOUND)
  203
+	SET(RAPTOR_PARSER_GRDDL_INIT TRUE)
  204
+ENDIF(LIBXML2_FOUND AND LIBXSLT_FOUND)
  205
+
  206
+SET(RAPTOR_PARSER_RDFXML ${RAPTOR_PARSER_RDFXML_INIT}
  207
+	CACHE BOOL "Build RDF/XML parser.")
  208
+SET(RAPTOR_PARSER_NTRIPLES TRUE
  209
+	CACHE BOOL "Build N-Triples parser.")
  210
+SET(RAPTOR_PARSER_TURTLE TRUE
  211
+	CACHE BOOL "Build Turtle parser.")
  212
+SET(RAPTOR_PARSER_TRIG TRUE
  213
+	CACHE BOOL "Build TRiG parser.")
  214
+SET(RAPTOR_PARSER_RSS ${LIBXML2_FOUND}
  215
+	CACHE BOOL "Build RSS Tag Soup parser.")
  216
+SET(RAPTOR_PARSER_GRDDL ${RAPTOR_PARSER_GRDDL_INIT}
  217
+	CACHE BOOL "Build GRDDL parser.")
  218
+SET(RAPTOR_PARSER_GUESS TRUE
  219
+	CACHE BOOL "Build guess parser.")
  220
+SET(RAPTOR_PARSER_RDFA ${LIBXML2_FOUND}
  221
+	CACHE BOOL "Build RDFA parser.")
  222
+SET(RAPTOR_PARSER_JSON ${YAJL_FOUND}
  223
+	CACHE BOOL "Build JSON parser.")
  224
+SET(RAPTOR_PARSER_NQUADS TRUE
  225
+	CACHE BOOL "Build N-Quads parser.")
  226
+
  227
+SET(RAPTOR_SERIALIZER_RDFXML TRUE
  228
+	CACHE BOOL "Build RDF/XML serializer.")
  229
+SET(RAPTOR_SERIALIZER_NTRIPLES TRUE
  230
+	CACHE BOOL "Build N-Triples serializer.")
  231
+SET(RAPTOR_SERIALIZER_RDFXML_ABBREV TRUE
  232
+	CACHE BOOL "Build RDF/XML-abbreviated serializer.")
  233
+SET(RAPTOR_SERIALIZER_TURTLE TRUE
  234
+	CACHE BOOL "Build Turtle serializer.")
  235
+SET(RAPTOR_SERIALIZER_RSS_1_0 TRUE
  236
+	CACHE BOOL "Build RSS 1.0 serializer.")
  237
+SET(RAPTOR_SERIALIZER_ATOM TRUE
  238
+	CACHE BOOL "Build Atom 1.0 serializer.")
  239
+SET(RAPTOR_SERIALIZER_DOT TRUE
  240
+	CACHE BOOL "Build GraphViz DOT serializer.")
  241
+SET(RAPTOR_SERIALIZER_HTML TRUE
  242
+	CACHE BOOL "Build HTML Table serializer.")
  243
+SET(RAPTOR_SERIALIZER_JSON TRUE
  244
+	CACHE BOOL "Build JSON serializer.")
  245
+SET(RAPTOR_SERIALIZER_NQUADS TRUE
  246
+	CACHE BOOL "Build N-Quads serializer.")
  247
+
  248
+################################################################
  249
+
  250
+CONFIGURE_FILE(
  251
+	src/raptor_config_cmake.h.in
  252
+	src/raptor_config.h
  253
+	@ONLY
  254
+)
  255
+
  256
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
  257
+
  258
+CONFIGURE_FILE(
  259
+	src/raptor2.h.in
  260
+	src/raptor2.h
  261
+	@ONLY
  262
+)
  263
+
  264
+# On Windows, the test/utility programs usually have DLL dependencies that
  265
+# make them cumbersome to invoke within IDE environments, so we enable the
  266
+# test suite only when makefiles are being used.
  267
+#
  268
+# Note that a partial solution is described at
  269
+#
  270
+#	http://www.cmake.org/pipermail/cmake/2009-May/029464.html
  271
+#
  272
+# but we don't have a good way of knowing where the third-party DLLs are.
  273
+#
  274
+IF(CMAKE_GENERATOR MATCHES "Makefiles")
  275
+	ENABLE_TESTING()
  276
+ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
  277
+
  278
+SUBDIRS(src)
  279
+SUBDIRS(utils)
  280
+
  281
+################################################################
  282
+
  283
+FIND_PROGRAM(JING jing)
  284
+IF(NOT JING STREQUAL "JING-NOTFOUND")
  285
+	SET(HAVE_JING TRUE)
  286
+ENDIF(NOT JING STREQUAL "JING-NOTFOUND")
  287
+
  288
+SET(RAPPER  ${CMAKE_BINARY_DIR}/utils/rapper)
  289
+SET(RDFDIFF ${CMAKE_BINARY_DIR}/utils/rdfdiff)
  290
+
  291
+MACRO(RAPPER_TEST NAME_PREFIX COMMAND OUTPUT REFERENCE)
  292
+	FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test-${NAME_PREFIX}.cmake "
  293
+EXECUTE_PROCESS(
  294
+	COMMAND ${COMMAND}
  295
+	TIMEOUT 10
  296
+	OUTPUT_FILE ${OUTPUT}.raw
  297
+	ERROR_QUIET
  298
+)
  299
+
  300
+# http://public.kitware.com/Bug/view.php?id=13007
  301
+
  302
+CONFIGURE_FILE(
  303
+	${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}.raw
  304
+	${OUTPUT}
  305
+	@ONLY
  306
+	NEWLINE_STYLE UNIX
  307
+)
  308
+")
  309
+	ADD_TEST("${NAME_PREFIX}:run" ${CMAKE_COMMAND} -P test-${NAME_PREFIX}.cmake)
  310
+	ADD_TEST("${NAME_PREFIX}:cmp" ${CMAKE_COMMAND} -E compare_files ${REFERENCE} ${OUTPUT})
  311
+ENDMACRO(RAPPER_TEST NAME_PREFIX COMMAND OUTPUT REFERENCE)
  312
+
  313
+MACRO(RAPPER_RDFDIFF_TEST NAME RAPPER_COMMAND RAPPER_OUTPUT RDFDIFF_COMMAND)
  314
+	FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test-${NAME}.cmake "
  315
+SET(rdfdiff_status -1)
  316
+
  317
+EXECUTE_PROCESS(
  318
+	COMMAND ${RAPPER_COMMAND}
  319
+	TIMEOUT 10
  320
+	OUTPUT_FILE ${RAPPER_OUTPUT}
  321
+	ERROR_QUIET
  322
+	RESULT_VARIABLE rapper_status
  323
+)
  324
+
  325
+IF(rapper_status EQUAL 0 OR rapper_status EQUAL 2)
  326
+	EXECUTE_PROCESS(
  327
+		COMMAND ${RDFDIFF_COMMAND}
  328
+		TIMEOUT 10
  329
+		OUTPUT_QUIET
  330
+		ERROR_QUIET
  331
+		RESULT_VARIABLE rdfdiff_status
  332
+	)
  333
+ENDIF(rapper_status EQUAL 0 OR rapper_status EQUAL 2)
  334
+
  335
+IF(NOT rdfdiff_status EQUAL 0)
  336
+	MESSAGE(FATAL_ERROR "Test failed.")
  337
+ENDIF(NOT rdfdiff_status EQUAL 0)
  338
+")
  339
+
  340
+	ADD_TEST(${NAME} ${CMAKE_COMMAND} -P test-${NAME}.cmake)
  341
+ENDMACRO(RAPPER_RDFDIFF_TEST NAME RAPPER_COMMAND RAPPER_OUTPUT RDFDIFF_COMMAND)
  342
+
  343
+SUBDIRS(tests/feeds)
  344
+SUBDIRS(tests/grddl)
  345
+SUBDIRS(tests/json)
  346
+SUBDIRS(tests/ntriples)
  347
+SUBDIRS(tests/rdfa)
  348
+SUBDIRS(tests/rdfa11)
  349
+SUBDIRS(tests/rdfxml)
  350
+SUBDIRS(tests/trig)
  351
+#SUBDIRS(tests/turtle)	# TODO
  352
+
  353
+# end raptor/CMakeLists.txt
1  Makefile.am
@@ -28,6 +28,7 @@ pkgconfigdir = $(libdir)/pkgconfig
28 28
 pkgconfig_DATA = raptor2.pc
29 29
 
30 30
 EXTRA_DIST=\
  31
+CMakeLists.txt \
31 32
 ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 ChangeLog.5 \
32 33
 ChangeLog.6 ChangeLog.7 ChangeLog.8 ChangeLog.9 ChangeLog.10 ChangeLog.11 \
33 34
 ChangeLog.12 \
4  librdfa/config.h
... ...
@@ -1,6 +1,2 @@
1 1
 /* Fake librdfa config.h - reads configuration from Raptor's config header */
2  
-#ifdef WIN32
3  
-#include <win32_raptor_config.h>
4  
-#else
5 2
 #include <raptor_config.h>
6  
-#endif
336  src/CMakeLists.txt
... ...
@@ -0,0 +1,336 @@
  1
+# raptor/src/CMakeLists.txt
  2
+#
  3
+# Original listfile by Daniel Richard G. <skunk@iSKUNK.ORG>
  4
+# This file is in the public domain.
  5
+#
  6
+
  7
+IF(RAPTOR_PARSER_RDFA)
  8
+	INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/librdfa)
  9
+ENDIF(RAPTOR_PARSER_RDFA)
  10
+
  11
+INCLUDE_DIRECTORIES(BEFORE
  12
+	${CMAKE_CURRENT_SOURCE_DIR}
  13
+	${CMAKE_CURRENT_BINARY_DIR}
  14
+)
  15
+
  16
+IF(RAPTOR_PARSER_RDFXML)
  17
+	SET(raptor_parser_rdfxml_sources raptor_rdfxml.c)
  18
+	SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
  19
+ENDIF(RAPTOR_PARSER_RDFXML)
  20
+IF(RAPTOR_PARSER_NTRIPLES OR RAPTOR_PARSER_NQUADS)
  21
+	SET(raptor_parser_ntriples_nquads_sources ntriples_parse.c)
  22
+ENDIF(RAPTOR_PARSER_NTRIPLES OR RAPTOR_PARSER_NQUADS)
  23
+IF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG)
  24
+	SET(raptor_parser_turtle_trig_sources
  25
+		turtle_common.h
  26
+		turtle_lexer.c
  27
+		turtle_lexer.h
  28
+		turtle_parser.c
  29
+		turtle_parser.h
  30
+	)
  31
+ENDIF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG)
  32
+IF(RAPTOR_PARSER_RSS OR RAPTOR_SERIALIZER_RSS_1_0)
  33
+	SET(raptor_rss_common_sources raptor_rss_common.c raptor_rss.h)
  34
+ENDIF(RAPTOR_PARSER_RSS OR RAPTOR_SERIALIZER_RSS_1_0)
  35
+IF(RAPTOR_PARSER_RSS)
  36
+	SET(raptor_parser_rss_sources raptor_rss.c)
  37
+	SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
  38
+ENDIF(RAPTOR_PARSER_RSS)
  39
+IF(RAPTOR_PARSER_GRDDL)
  40
+	SET(raptor_parser_grddl_sources raptor_grddl.c)
  41
+	SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
  42
+	SET(raptor_libxslt_libs ${LIBXSLT_LIBRARIES})
  43
+ENDIF(RAPTOR_PARSER_GRDDL)
  44
+IF(RAPTOR_PARSER_GUESS)
  45
+	SET(raptor_parser_guess_sources raptor_guess.c)
  46
+ENDIF(RAPTOR_PARSER_GUESS)
  47
+IF(RAPTOR_PARSER_RDFA)
  48
+	SET(raptor_parser_rdfa_sources raptor_librdfa.c)
  49
+ENDIF(RAPTOR_PARSER_RDFA)
  50
+IF(RAPTOR_PARSER_JSON)
  51
+	SET(raptor_parser_json_sources raptor_json.c)
  52
+ENDIF(RAPTOR_PARSER_JSON)
  53
+
  54
+IF(RAPTOR_SERIALIZER_RDFXML)
  55
+	SET(raptor_serializer_rdfxml_sources raptor_serialize_rdfxml.c)
  56
+ENDIF(RAPTOR_SERIALIZER_RDFXML)
  57
+IF(RAPTOR_SERIALIZER_NTRIPLES OR RAPTOR_SERIALIZER_NQUADS)
  58
+	SET(raptor_serializer_ntriples_nquads_sources raptor_serialize_ntriples.c)
  59
+ENDIF(RAPTOR_SERIALIZER_NTRIPLES OR RAPTOR_SERIALIZER_NQUADS)
  60
+IF(RAPTOR_SERIALIZER_RDFXML_ABBREV OR RAPTOR_SERIALIZER_TURTLE)
  61
+	SET(raptor_serializer_abbrev_sources raptor_abbrev.c)
  62
+ENDIF(RAPTOR_SERIALIZER_RDFXML_ABBREV OR RAPTOR_SERIALIZER_TURTLE)
  63
+IF(RAPTOR_SERIALIZER_RDFXML_ABBREV)
  64
+	SET(raptor_serializer_rdfxml_abbrev_sources raptor_serialize_rdfxmla.c)
  65
+ENDIF(RAPTOR_SERIALIZER_RDFXML_ABBREV)
  66
+IF(RAPTOR_SERIALIZER_TURTLE)
  67
+	SET(raptor_serializer_turtle_sources raptor_serialize_turtle.c)
  68
+ENDIF(RAPTOR_SERIALIZER_TURTLE)
  69
+IF(RAPTOR_SERIALIZER_RSS_1_0)
  70
+	SET(raptor_serializer_rss_1_0_sources raptor_serialize_rss.c)
  71
+ENDIF(RAPTOR_SERIALIZER_RSS_1_0)
  72
+IF(RAPTOR_SERIALIZER_DOT)
  73
+	SET(raptor_serializer_dot_sources raptor_serialize_dot.c)
  74
+ENDIF(RAPTOR_SERIALIZER_DOT)
  75
+IF(RAPTOR_SERIALIZER_HTML)
  76
+	SET(raptor_serializer_html_sources raptor_serialize_html.c)
  77
+ENDIF(RAPTOR_SERIALIZER_HTML)
  78
+IF(RAPTOR_SERIALIZER_JSON)
  79
+	SET(raptor_serializer_json_sources raptor_serialize_json.c)
  80
+	SET(raptor_yajl_libs ${YAJL_LIBRARIES})
  81
+ENDIF(RAPTOR_SERIALIZER_JSON)
  82
+
  83
+IF(RAPTOR_WWW STREQUAL "curl")
  84
+	SET(raptor_www_sources raptor_www_curl.c)
  85
+	SET(raptor_www_libs ${CURL_LIBRARIES})
  86
+ELSEIF(RAPTOR_WWW STREQUAL "fetch")
  87
+	SET(raptor_www_sources raptor_www_libfetch.c)
  88
+	#SET(raptor_www_libs ${FETCH_LIBRARIES})
  89
+ELSEIF(RAPTOR_WWW STREQUAL "xml")
  90
+	SET(raptor_www_sources raptor_www_libxml.c)
  91
+	SET(raptor_www_libs ${LIBXML2_LIBRARIES})
  92
+ENDIF(RAPTOR_WWW STREQUAL "curl")
  93
+
  94
+IF(RAPTOR_XML STREQUAL "libxml")
  95
+	SET(raptor_libxml_sources raptor_libxml.c)
  96
+	SET(raptor_libxml_libs ${LIBXML2_LIBRARIES})
  97
+ENDIF(RAPTOR_XML STREQUAL "libxml")
  98
+IF(RAPTOR_PARSER_RDFA)
  99
+	SET(raptor_librdfa_sources
  100
+		${CMAKE_SOURCE_DIR}/librdfa/context.c
  101
+		${CMAKE_SOURCE_DIR}/librdfa/curie.c
  102
+		${CMAKE_SOURCE_DIR}/librdfa/iri.c
  103
+		${CMAKE_SOURCE_DIR}/librdfa/language.c
  104
+		${CMAKE_SOURCE_DIR}/librdfa/lists.c
  105
+		${CMAKE_SOURCE_DIR}/librdfa/namespace.c
  106
+		${CMAKE_SOURCE_DIR}/librdfa/rdfa.c
  107
+		${CMAKE_SOURCE_DIR}/librdfa/rdfa_utils.c
  108
+		${CMAKE_SOURCE_DIR}/librdfa/strtok_r.c
  109
+		${CMAKE_SOURCE_DIR}/librdfa/subject.c
  110
+		${CMAKE_SOURCE_DIR}/librdfa/triple.c
  111
+		${CMAKE_SOURCE_DIR}/librdfa/rdfa.h
  112
+		${CMAKE_SOURCE_DIR}/librdfa/rdfa_utils.h
  113
+		${CMAKE_SOURCE_DIR}/librdfa/strtok_r.h
  114
+	)
  115
+ENDIF(RAPTOR_PARSER_RDFA)
  116
+IF(NOT HAVE_STRCASECMP AND NOT HAVE_STRICMP)
  117
+	SET(raptor_strcasecmp_sources strcasecmp.c)
  118
+ENDIF(NOT HAVE_STRCASECMP AND NOT HAVE_STRICMP)
  119
+IF(RAPTOR_PARSEDATE)
  120
+	SET(raptor_parsedate_sources parsedate.c)
  121
+ENDIF(RAPTOR_PARSEDATE)
  122
+
  123
+ADD_LIBRARY(raptor2
  124
+	raptor_avltree.c
  125
+	raptor_concepts.c
  126
+	raptor_general.c
  127
+	raptor_iostream.c
  128
+	raptor_json_writer.c
  129
+	raptor_locator.c
  130
+	raptor_log.c
  131
+	raptor_memstr.c
  132
+	raptor_namespace.c
  133
+	raptor_option.c
  134
+	raptor_parse.c
  135
+	raptor_qname.c
  136
+	raptor_rfc2396.c
  137
+	raptor_sax2.c
  138
+	raptor_sequence.c
  139
+	raptor_serialize.c
  140
+	raptor_set.c
  141
+	raptor_statement.c
  142
+	raptor_stringbuffer.c
  143
+	raptor_syntax_description.c
  144
+	raptor_term.c
  145
+	raptor_turtle_writer.c
  146
+	raptor_unicode.c
  147
+	raptor_uri.c
  148
+	raptor_www.c
  149
+	raptor_xml.c
  150
+	raptor_xml_writer.c
  151
+	snprintf.c
  152
+	turtle_common.c
  153
+	${raptor_parser_rdfxml_sources}
  154
+	${raptor_parser_ntriples_nquads_sources}
  155
+	${raptor_parser_turtle_trig_sources}
  156
+	${raptor_rss_common_sources}
  157
+	${raptor_parser_rss_sources}
  158
+	${raptor_parser_grddl_sources}
  159
+	${raptor_parser_guess_sources}
  160
+	${raptor_parser_rdfa_sources}
  161
+	${raptor_parser_json_sources}
  162
+	${raptor_serializer_rdfxml_sources}
  163
+	${raptor_serializer_ntriples_nquads_sources}
  164
+	${raptor_serializer_abbrev_sources}
  165
+	${raptor_serializer_rdfxml_abbrev_sources}
  166
+	${raptor_serializer_turtle_sources}
  167
+	${raptor_serializer_rss_1_0_sources}
  168
+	${raptor_serializer_dot_sources}
  169
+	${raptor_serializer_html_sources}
  170
+	${raptor_serializer_json_sources}
  171
+	${raptor_www_sources}
  172
+	${raptor_libxml_sources}
  173
+	${raptor_librdfa_sources}
  174
+	${raptor_strcasecmp_sources}
  175
+	${raptor_parsedate_sources}
  176
+)
  177
+
  178
+TARGET_LINK_LIBRARIES(raptor2
  179
+	${raptor_libxslt_libs}
  180
+	${raptor_libxml_libs}
  181
+	${raptor_yajl_libs}
  182
+	${raptor_www_libs}
  183
+)
  184
+
  185
+SET_TARGET_PROPERTIES(
  186
+	raptor2
  187
+	PROPERTIES
  188
+	COMPILE_DEFINITIONS "LIBRDFA_IN_RAPTOR;RAPTOR_INTERNAL;${LIBXML2_DEFINITIONS};${LIBXSLT_DEFINITIONS}"
  189
+)
  190
+
  191
+ADD_EXECUTABLE(turtle_lexer_test turtle_lexer.c)
  192
+TARGET_LINK_LIBRARIES(turtle_lexer_test raptor2)
  193
+
  194
+IF(NOT WIN32 OR NOT BUILD_SHARED_LIBS)
  195
+	# This currently cannot be built on Windows with DLL linkage
  196
+	ADD_EXECUTABLE(turtle_parser_test turtle_parser.c)
  197
+	TARGET_LINK_LIBRARIES(turtle_parser_test raptor2)
  198
+	SET_TARGET_PROPERTIES(
  199
+		turtle_parser_test
  200
+		PROPERTIES
  201
+		COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE"
  202
+	)
  203
+ENDIF(NOT WIN32 OR NOT BUILD_SHARED_LIBS)
  204
+
  205
+ADD_EXECUTABLE(raptor_parse_test raptor_parse.c)
  206
+TARGET_LINK_LIBRARIES(raptor_parse_test raptor2)
  207
+ADD_TEST(raptor_parse_test raptor_parse_test)
  208
+
  209
+ADD_EXECUTABLE(raptor_rfc2396_test raptor_rfc2396.c)
  210
+TARGET_LINK_LIBRARIES(raptor_rfc2396_test raptor2)
  211
+ADD_TEST(raptor_rfc2396_test raptor_rfc2396_test)
  212
+
  213
+ADD_EXECUTABLE(raptor_uri_test raptor_uri.c)
  214
+TARGET_LINK_LIBRARIES(raptor_uri_test raptor2)
  215
+ADD_TEST(raptor_uri_test raptor_uri_test)
  216
+
  217
+ADD_EXECUTABLE(raptor_namespace_test raptor_namespace.c)
  218
+TARGET_LINK_LIBRARIES(raptor_namespace_test raptor2)
  219
+ADD_TEST(raptor_namespace_test raptor_namespace_test)
  220
+
  221
+ADD_EXECUTABLE(strcasecmp_test strcasecmp.c)
  222
+TARGET_LINK_LIBRARIES(strcasecmp_test raptor2)
  223
+ADD_TEST(strcasecmp_test strcasecmp_test)
  224
+
  225
+ADD_EXECUTABLE(raptor_www_test raptor_www_test.c)
  226
+TARGET_LINK_LIBRARIES(raptor_www_test raptor2)
  227
+ADD_TEST(raptor_www_test raptor_www_test)
  228
+
  229
+ADD_EXECUTABLE(raptor_sequence_test raptor_sequence.c)
  230
+TARGET_LINK_LIBRARIES(raptor_sequence_test raptor2)
  231
+ADD_TEST(raptor_sequence_test raptor_sequence_test)
  232
+
  233
+ADD_EXECUTABLE(raptor_stringbuffer_test raptor_stringbuffer.c)
  234
+TARGET_LINK_LIBRARIES(raptor_stringbuffer_test raptor2)
  235
+ADD_TEST(raptor_stringbuffer_test raptor_stringbuffer_test)
  236
+
  237
+ADD_EXECUTABLE(raptor_iostream_test raptor_iostream.c)
  238
+TARGET_LINK_LIBRARIES(raptor_iostream_test raptor2)
  239
+ADD_TEST(raptor_iostream_test raptor_iostream_test)
  240
+
  241
+ADD_EXECUTABLE(raptor_xml_writer_test raptor_xml_writer.c)
  242
+TARGET_LINK_LIBRARIES(raptor_xml_writer_test raptor2)
  243
+ADD_TEST(raptor_xml_writer_test raptor_xml_writer_test)
  244
+
  245
+ADD_EXECUTABLE(raptor_turtle_writer_test raptor_turtle_writer.c)
  246
+TARGET_LINK_LIBRARIES(raptor_turtle_writer_test raptor2)
  247
+ADD_TEST(raptor_turtle_writer_test raptor_turtle_writer_test)
  248
+
  249
+ADD_EXECUTABLE(raptor_avltree_test raptor_avltree.c)
  250
+TARGET_LINK_LIBRARIES(raptor_avltree_test raptor2)
  251
+ADD_TEST(raptor_avltree_test raptor_avltree_test)
  252
+
  253
+ADD_EXECUTABLE(raptor_term_test raptor_term.c)
  254
+TARGET_LINK_LIBRARIES(raptor_term_test raptor2)
  255
+ADD_TEST(raptor_term_test raptor_term_test)
  256
+
  257
+ADD_EXECUTABLE(raptor_permute_test raptor_permute_test.c)
  258
+TARGET_LINK_LIBRARIES(raptor_permute_test raptor2)
  259
+ADD_TEST(raptor_permute_test raptor_permute_test)
  260
+
  261
+SET_TARGET_PROPERTIES(
  262
+	turtle_lexer_test
  263
+	#turtle_parser_test
  264
+	raptor_parse_test
  265
+	raptor_rfc2396_test
  266
+	raptor_uri_test
  267
+	raptor_namespace_test
  268
+	strcasecmp_test
  269
+	raptor_www_test
  270
+	raptor_sequence_test
  271
+	raptor_stringbuffer_test
  272
+	raptor_iostream_test
  273
+	raptor_xml_writer_test
  274
+	raptor_turtle_writer_test
  275
+	raptor_avltree_test
  276
+	raptor_term_test
  277
+	raptor_permute_test
  278
+	PROPERTIES
  279
+	COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE"
  280
+)
  281
+
  282
+IF(RAPTOR_PARSER_RDFXML)
  283
+	ADD_EXECUTABLE(raptor_set_test raptor_set.c)
  284
+	TARGET_LINK_LIBRARIES(raptor_set_test raptor2)
  285
+	ADD_TEST(raptor_set_test raptor_set_test)
  286
+
  287
+	ADD_EXECUTABLE(raptor_xml_test raptor_xml.c)
  288
+	TARGET_LINK_LIBRARIES(raptor_xml_test raptor2)
  289
+	ADD_TEST(raptor_xml_test raptor_xml_test)
  290
+
  291
+	SET_TARGET_PROPERTIES(
  292
+		raptor_set_test
  293
+		raptor_xml_test
  294
+		PROPERTIES
  295
+		COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE"
  296
+	)
  297
+ENDIF(RAPTOR_PARSER_RDFXML)
  298
+
  299
+# Generate pkg-config metadata file
  300
+#
  301
+FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/raptor2.pc
  302
+"prefix=${CMAKE_INSTALL_PREFIX}
  303
+exec_prefix=\${prefix}
  304
+libdir=\${exec_prefix}/lib
  305
+includedir=\${prefix}/include/raptor2
  306
+
  307
+Name: Raptor RDF Parsing Library
  308
+Description: RDF Parser Toolkit Library
  309
+Version: ${VERSION}
  310
+Libs: -L\${libdir} -lraptor2
  311
+Libs.private: ${raptor_libxslt_libs} ${raptor_libxml_libs}
  312
+Cflags: -I\${includedir}
  313
+")
  314
+
  315
+INSTALL(FILES
  316
+	raptor.h
  317
+	${CMAKE_CURRENT_BINARY_DIR}/raptor2.h
  318
+	DESTINATION include/raptor2
  319
+)
  320
+
  321
+INSTALL(FILES
  322
+	${CMAKE_CURRENT_BINARY_DIR}/raptor2.pc
  323
+	DESTINATION lib/pkgconfig
  324
+)
  325
+
  326
+INSTALL(
  327
+	TARGETS raptor2
  328
+	EXPORT  Raptor2Config
  329
+	ARCHIVE DESTINATION lib
  330
+	LIBRARY DESTINATION lib
  331
+	RUNTIME DESTINATION bin
  332
+)
  333
+
  334
+INSTALL(EXPORT Raptor2Config DESTINATION lib/cmake)
  335
+
  336
+# end raptor/src/CMakeLists.txt
2  src/Makefile.am
@@ -191,6 +191,8 @@ libraptor2_la_LIBADD = @LTLIBOBJS@
191 191
 
192 192
 
193 193
 EXTRA_DIST=\
  194
+CMakeLists.txt \
  195
+raptor_config_cmake.h.in \
194 196
 raptor_permute_test.c \
195 197
 raptor_www_test.c \
196 198
 raptor_nfc_test.c \
131  src/raptor_config_cmake.h.in
... ...
@@ -0,0 +1,131 @@
  1
+/* raptor_config.h */
  2
+
  3
+#define RAPTOR_VERSION_DECIMAL		@RAPTOR_VERSION_DECIMAL@
  4
+#define RAPTOR_MIN_VERSION_DECIMAL	@RAPTOR_MIN_VERSION_DECIMAL@
  5
+
  6
+#cmakedefine HAVE_ERRNO_H
  7
+#cmakedefine HAVE_FCNTL_H
  8
+#cmakedefine HAVE_GETOPT_H
  9
+#cmakedefine HAVE_LIMITS_H
  10
+#cmakedefine HAVE_MATH_H
  11
+#cmakedefine HAVE_SETJMP_H
  12
+#cmakedefine HAVE_STDDEF_H
  13
+#cmakedefine HAVE_STDLIB_H
  14
+#cmakedefine HAVE_STRING_H
  15
+#cmakedefine HAVE_UNISTD_H
  16
+#cmakedefine HAVE_SYS_PARAM_H
  17
+#cmakedefine HAVE_SYS_STAT_H
  18
+#cmakedefine HAVE_SYS_STAT_H
  19
+#cmakedefine HAVE_SYS_TIME_H
  20
+
  21
+#cmakedefine TIME_WITH_SYS_TIME
  22
+
  23
+#cmakedefine HAVE_ACCESS
  24
+#cmakedefine HAVE__ACCESS
  25
+#cmakedefine HAVE_GETOPT
  26
+#cmakedefine HAVE_GETOPT_LONG
  27
+#cmakedefine HAVE_GETTIMEOFDAY
  28
+#cmakedefine HAVE_ISASCII
  29
+#cmakedefine HAVE_SETJMP
  30
+#cmakedefine HAVE_SNPRINTF
  31
+#cmakedefine HAVE__SNPRINTF
  32
+#cmakedefine HAVE_STAT
  33
+#cmakedefine HAVE_STRCASECMP
  34
+#cmakedefine HAVE_STRICMP
  35
+#cmakedefine HAVE__STRICMP
  36
+#cmakedefine HAVE_STRTOK_R
  37
+#cmakedefine HAVE_VASPRINTF
  38
+#cmakedefine HAVE_VSNPRINTF
  39
+#cmakedefine HAVE__VSNPRINTF
  40
+
  41
+#define SIZEOF_UNSIGNED_CHAR		@SIZEOF_UNSIGNED_CHAR@
  42
+#define SIZEOF_UNSIGNED_SHORT		@SIZEOF_UNSIGNED_SHORT@
  43
+#define SIZEOF_UNSIGNED_INT		@SIZEOF_UNSIGNED_INT@
  44
+#define SIZEOF_UNSIGNED_LONG		@SIZEOF_UNSIGNED_LONG@
  45
+#define SIZEOF_UNSIGNED_LONG_LONG	@SIZEOF_UNSIGNED_LONG_LONG@
  46
+
  47
+#cmakedefine HAVE_XMLCTXTUSEOPTIONS
  48
+#cmakedefine HAVE_XMLSAX2INTERNALSUBSET
  49
+#cmakedefine RAPTOR_LIBXML_ENTITY_ETYPE
  50
+#cmakedefine RAPTOR_LIBXML_ENTITY_NAME_LENGTH
  51
+#cmakedefine RAPTOR_LIBXML_HTML_PARSE_NONET
  52
+#cmakedefine RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET
  53
+#cmakedefine RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED
  54
+#cmakedefine RAPTOR_LIBXML_XML_PARSE_NONET
  55
+
  56
+#cmakedefine RAPTOR_STATIC
  57
+#cmakedefine HAVE_RAPTOR_PARSE_DATE
  58
+#define @RAPTOR_WWW_DEFINE@
  59
+#define @RAPTOR_XML_DEFINE@
  60
+#cmakedefine RAPTOR_XML_1_1
  61
+
  62
+#cmakedefine RAPTOR_PARSER_RDFXML
  63
+#cmakedefine RAPTOR_PARSER_NTRIPLES
  64
+#cmakedefine RAPTOR_PARSER_TURTLE
  65
+#cmakedefine RAPTOR_PARSER_TRIG
  66
+#cmakedefine RAPTOR_PARSER_RSS
  67
+#cmakedefine RAPTOR_PARSER_GRDDL
  68
+#cmakedefine RAPTOR_PARSER_GUESS
  69
+#cmakedefine RAPTOR_PARSER_RDFA
  70
+#cmakedefine RAPTOR_PARSER_JSON
  71
+#cmakedefine RAPTOR_PARSER_NQUADS
  72
+
  73
+#cmakedefine RAPTOR_SERIALIZER_RDFXML
  74
+#cmakedefine RAPTOR_SERIALIZER_NTRIPLES
  75
+#cmakedefine RAPTOR_SERIALIZER_RDFXML_ABBREV
  76
+#cmakedefine RAPTOR_SERIALIZER_TURTLE
  77
+#cmakedefine RAPTOR_SERIALIZER_RSS_1_0
  78
+#cmakedefine RAPTOR_SERIALIZER_ATOM
  79
+#cmakedefine RAPTOR_SERIALIZER_DOT
  80
+#cmakedefine RAPTOR_SERIALIZER_HTML
  81
+#cmakedefine RAPTOR_SERIALIZER_JSON
  82
+#cmakedefine RAPTOR_SERIALIZER_NQUADS
  83
+
  84
+#ifdef WIN32
  85
+#  define WIN32_LEAN_AND_MEAN
  86
+#  define _CRT_NONSTDC_NO_DEPRECATE
  87
+#  define _CRT_SECURE_NO_DEPRECATE
  88
+
  89
+#  ifdef _MSC_VER
  90
+#    if _MSC_VER >= 1300
  91
+#      define __func__		__FUNCTION__
  92
+#    else
  93
+       /* better than nothing */
  94
+#      define raptor_str(s)	#s
  95
+#      define __func__		"func@" __FILE__ ":" raptor_str(__LINE__)
  96
+#    endif
  97
+#  endif
  98
+
  99
+#  define RAPTOR_INLINE	__inline
  100
+
  101
+#  define S_ISTYPE(mode, mask)	(((mode) & _S_IFMT) == (mask))
  102
+#  define S_ISDIR(mode)		S_ISTYPE((mode), _S_IFDIR)
  103
+#  define S_ISREG(mode)		S_ISTYPE((mode), _S_IFREG)
  104
+
  105
+   /* Mode bits for access() */
  106
+#  define R_OK 04
  107
+#  define W_OK 02
  108
+
  109
+#  if !defined(HAVE_ACCESS) && defined(HAVE__ACCESS)
  110
+#    define access(p,m)		_access(p,m)
  111
+#  endif
  112
+#  ifndef HAVE_STRCASECMP
  113
+#    if defined(HAVE__STRICMP)
  114
+#      define strcasecmp(a,b)	_stricmp(a,b)
  115
+#    elif defined(HAVE_STRICMP)
  116
+#      define strcasecmp(a,b)	stricmp(a,b)
  117
+#    endif
  118
+#  endif
  119
+#  if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
  120
+#    define snprintf		_snprintf
  121
+#  endif
  122
+#  if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
  123
+#    define vsnprintf		_vsnprintf
  124
+#  endif
  125
+
  126
+   /* These prevent parsedate.c from declaring malloc() and free() */
  127
+#  define YYMALLOC malloc
  128
+#  define YYFREE   free
  129
+#endif
  130
+
  131
+/* end raptor_config.h */
2  src/win32_raptor_config.h.in
@@ -23,6 +23,7 @@
23 23
  */
24 24
 
25 25
 
  26
+#if 0 /**** obsolescent ****/
26 27
 #ifndef WIN32_CONFIG_H
27 28
 #define WIN32_CONFIG_H
28 29
 
@@ -166,3 +167,4 @@ extern "C" {
166 167
 #endif
167 168
 
168 169
 #endif
  170
+#endif /**** obsolescent ****/
75  tests/feeds/CMakeLists.txt
... ...
@@ -0,0 +1,75 @@
  1
+# raptor/tests/feeds/CMakeLists.txt
  2
+#
  3
+# Original listfile by Daniel Richard G. <skunk@iSKUNK.ORG>
  4
+# This file is in the public domain.
  5
+#
  6
+
  7
+IF(RAPTOR_PARSER_RDFXML)
  8
+
  9
+	RAPPER_TEST(feeds.test01.rdf
  10
+		"${RAPPER} -q -i rdfxml -o turtle -f writeBaseURI=0 -O http://example.org/whatsnew file:${CMAKE_CURRENT_SOURCE_DIR}/test01.rdf"
  11
+		test01.ttl
  12
+		${CMAKE_CURRENT_SOURCE_DIR}/test01-result.ttl
  13
+	)
  14
+
  15
+	RAPPER_TEST(feeds.test02.rdf
  16
+		"${RAPPER} -q -i rdfxml -o turtle -f writeBaseURI=0 -O http://example.org/news/ file:${CMAKE_CURRENT_SOURCE_DIR}/test02.rdf"
  17
+		test02.ttl
  18
+		${CMAKE_CURRENT_SOURCE_DIR}/test02-result.ttl
  19
+	)
  20
+
  21
+	RAPPER_TEST(feeds.test03.rdf
  22
+		"${RAPPER} -q -i rdfxml -o turtle -f writeBaseURI=0 -O http://example.org file:${CMAKE_CURRENT_SOURCE_DIR}/test03.rdf"
  23
+		test03.ttl
  24
+		${CMAKE_CURRENT_SOURCE_DIR}/test03-result.ttl
  25
+	)
  26
+
  27
+ENDIF(RAPTOR_PARSER_RDFXML)
  28
+
  29
+IF(RAPTOR_PARSER_RSS)
  30
+
  31
+	RAPPER_TEST(feeds.test04.atom
  32
+		"${RAPPER} -q -i rss-tag-soup -o turtle -f writeBaseURI=0 -O http://www.example.org/blog/ file:${CMAKE_CURRENT_SOURCE_DIR}/test04.atom"
  33
+		test04.ttl
  34
+		${CMAKE_CURRENT_SOURCE_DIR}/test04-result.ttl
  35
+	)
  36
+
  37
+	RAPPER_TEST(feeds.test05.atom
  38
+		"${RAPPER} -q -i rss-tag-soup -o turtle -f writeBaseURI=0 -O http://www.example.org/blog/ file:${CMAKE_CURRENT_SOURCE_DIR}/test05.atom"
  39
+		test05.ttl
  40
+		${CMAKE_CURRENT_SOURCE_DIR}/test05-result.ttl
  41
+	)
  42
+
  43
+ENDIF(RAPTOR_PARSER_RSS)
  44
+
  45
+IF(RAPTOR_SERIALIZER_ATOM)
  46
+
  47
+	RAPPER_TEST(feeds.test01.ttl
  48
+		"${RAPPER} -q -i turtle -o atom -f writeBaseURI=0 -f rssTriples=atom-triples -f atomEntryUri=http://example.org/2006/03/28/blog-item -I http://example.org/whatsnew -O http://example.org/whatsnew file:test01.ttl"
  49
+		test01.atom
  50
+		${CMAKE_CURRENT_SOURCE_DIR}/test01-result.atom
  51
+	)
  52
+
  53
+	RAPPER_TEST(feeds.test02.ttl
  54
+		"${RAPPER} -q -i turtle -o atom -f writeBaseURI=0 -f rssTriples=atom-triples -I http://example.org/news/ -O http://example.org/news/ file:test02.ttl"
  55
+		test02.atom
  56
+		${CMAKE_CURRENT_SOURCE_DIR}/test02-result.atom
  57
+	)
  58
+
  59
+	RAPPER_TEST(feeds.test03.ttl
  60
+		"${RAPPER} -q -i turtle -o atom -f writeBaseURI=0 -f rssTriples=atom-triples -I http://example.org -O http://example.org file:test03.ttl"
  61
+		test03.atom
  62
+		${CMAKE_CURRENT_SOURCE_DIR}/test03-result.atom
  63
+	)
  64
+
  65
+ENDIF(RAPTOR_SERIALIZER_ATOM)
  66
+
  67
+IF(HAVE_JING)
  68
+	ADD_TEST(feeds.jing-test01.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng test01.atom)
  69
+	ADD_TEST(feeds.jing-test02.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng test02.atom)
  70
+	ADD_TEST(feeds.jing-test03.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng test03.atom)
  71
+	ADD_TEST(feeds.jing-test04.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng ${CMAKE_CURRENT_SOURCE_DIR}/test04.atom)
  72
+	ADD_TEST(feeds.jing-test05.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng ${CMAKE_CURRENT_SOURCE_DIR}/test05.atom)
  73
+ENDIF(HAVE_JING)
  74
+
  75
+# end raptor/tests/feeds/CMakeLists.txt
33  tests/feeds/Makefile.am
@@ -39,11 +39,12 @@ OUT_TTLS = $(OUT_RDF_TTLS) $(OUT_ATOM_TTLS)
39 39
 OUT_ATOMS = $(OUT_RDF_ATOMS)
40 40
 
41 41
 EXTRA_DIST = \
  42
+CMakeLists.txt \
42 43
 $(TEST_IN_RDF_ATOMS) $(TEST_IN_ATOMS) \
43 44
 $(EXPECTED_TTLS) $(EXPECTED_ATOMS) \
44 45
 atom.rng atom.rnc
45 46
 
46  
-CLEANFILES = $(OUT_ATOMS) $(OUT_TTLS) errors.log
  47
+CLEANFILES = $(OUT_ATOMS) $(OUT_TTLS) CMakeTests.txt errors.log
47 48
 
48 49
 RAPPER = $(top_builddir)/utils/rapper
49 50
 
@@ -81,6 +82,7 @@ endif
81 82
 check-rdfxml-to-turtle: $(check_rdfxml_to_turtle_deps)
82 83
 	@set +e; result=0; \
83 84
 	$(RECHO) "Testing RDF/XML to Turtle"; \
  85
+	printf 'IF(RAPTOR_PARSER_RDFXML)\n\n' >>CMakeTests.txt; \
84 86
 	for test in $(TEST_IN_RDF_ATOMS); do \
85 87
 	  parser=rdfxml; \
86 88
 	  name=`basename $$test .rdf` ; \
@@ -111,7 +113,13 @@ check-rdfxml-to-turtle: $(check_rdfxml_to_turtle_deps)
111 113
 	    diff -u $(srcdir)/$$expected $$turtle; result=1; \
112 114
 	  fi; \
113 115
 	  rm -f errors.log ; \
  116
+	  printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \
  117
+		feeds.$$test \
  118
+		"\$${RAPPER} $$opts file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \
  119
+		$$turtle \
  120
+		"\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \
114 121
 	done; \
  122
+	printf 'ENDIF(RAPTOR_PARSER_RDFXML)\n\n' >>CMakeTests.txt; \
115 123
 	set -e; exit $$result
116 124
 
117 125
 if MAINTAINER_MODE
@@ -122,6 +130,7 @@ endif
122 130
 check-atom-to-turtle: $(check_atom_to_turtle_deps)
123 131
 	@set +e; result=0; \
124 132
 	$(RECHO) "Testing Atom to Turtle"; \
  133
+	printf 'IF(RAPTOR_PARSER_RSS)\n\n' >>CMakeTests.txt; \
125 134
 	for test in $(TEST_IN_ATOMS); do \
126 135
 	  parser=rss-tag-soup; \
127 136
 	  name=`basename $$test .atom` ; \
@@ -149,7 +158,13 @@ check-atom-to-turtle: $(check_atom_to_turtle_deps)
149 158
 	    diff -u $(srcdir)/$$expected $$turtle; result=1; \
150 159
 	  fi; \
151 160
 	  rm -f errors.log ; \
  161
+	  printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \
  162
+		feeds.$$test \
  163
+		"\$${RAPPER} $$opts file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \
  164
+		$$turtle \
  165
+		"\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \
152 166
 	done; \
  167
+	printf 'ENDIF(RAPTOR_PARSER_RSS)\n\n' >>CMakeTests.txt; \
153 168
 	set -e; exit $$result
154 169
 
155 170
 if MAINTAINER_MODE
@@ -160,6 +175,7 @@ endif
160 175
 check-serialize-atom: $(check_serialize_atom_deps)
161 176
 	@set +e; result=0; \
162 177
 	$(RECHO) "Testing Turtle to Atom XML"; \
  178
+	printf 'IF(RAPTOR_SERIALIZER_ATOM)\n\n' >>CMakeTests.txt; \
163 179
 	for test in $(OUT_RDF_TTLS); do \
164 180
 	  name=`basename $$test .ttl` ; \
165 181
 	  atom="$$name.atom"; \
@@ -190,7 +206,13 @@ check-serialize-atom: $(check_serialize_atom_deps)
190 206
 	    diff -u $(srcdir)/$$expected $$atom; result=1; \
191 207
 	  fi; \
192 208
 	  rm -f errors.log ; \
  209
+	  printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \
  210
+		feeds.$$test \
  211
+		"\$${RAPPER} $$opts file:$$test" \
  212
+		$$atom \
  213
+		"\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \
193 214
 	done; \
  215
+	printf 'ENDIF(RAPTOR_SERIALIZER_ATOM)\n\n' >>CMakeTests.txt; \
194 216
 	set -e; exit $$result
195 217
 
196 218
 
@@ -203,6 +225,7 @@ SUFFIXES = .rng .rnc
203 225
 check-validate-atom: $(srcdir)/atom.rng $(OUT_ATOMS) $(TEST_IN_ATOMS)
204 226
 	@set +e; result=0; \
205 227
 	$(RECHO) "Validating Atom XML with RelaxNG"; \
  228
+	printf 'IF(HAVE_JING)\n' >>CMakeTests.txt; \
206 229
 	for atom in $(OUT_ATOMS) $(TEST_IN_ATOMS); do \
207 230
 	  test -f $$atom || atom=$(srcdir)/$$atom; \
208 231
 	  $(RECHO) $(RECHO_N) "Validating $$atom $(RECHO_C)"; \
@@ -215,9 +238,13 @@ check-validate-atom: $(srcdir)/atom.rng $(OUT_ATOMS) $(TEST_IN_ATOMS)
215 238
 	    result=1 ; \
216 239
 	  else \
217 240
 	    $(RECHO) "ok"; \
218  
-          fi; \
219  
-          rm -f errors.log; \
  241
+	  fi; \
  242
+	  rm -f errors.log; \
  243
+	  printf '\tADD_TEST(%s %s)\n' \
  244
+		feeds.jing-$$atom \
  245
+		"\$${JING} \$${CMAKE_CURRENT_SOURCE_DIR}/atom.rng $$atom" >>CMakeTests.txt; \
220 246
 	done; \
  247
+	printf 'ENDIF(HAVE_JING)\n\n' >>CMakeTests.txt; \
221 248
 	set -e; exit $$result
222 249
 
223 250
 endif
17  tests/grddl/CMakeLists.txt
... ...
@@ -0,0 +1,17 @@
  1
+# raptor/tests/grddl/CMakeLists.txt
  2
+#
  3
+# Original listfile by Daniel Richard G. <skunk@iSKUNK.ORG>
  4
+# This file is in the public domain.
  5
+#
  6
+
  7
+IF(RAPTOR_PARSER_GRDDL)
  8
+
  9
+	RAPPER_TEST(grddl.test-01
  10
+		"${RAPPER} -f noNet -q -i grddl -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/test-01.html"
  11
+		test-01.res
  12
+		${CMAKE_CURRENT_SOURCE_DIR}/test-01.out
  13
+	)
  14
+
  15
+ENDIF(RAPTOR_PARSER_GRDDL)
  16
+
  17
+# end raptor/tests/grddl/CMakeLists.txt
11  tests/grddl/Makefile.am
@@ -32,7 +32,9 @@ ALL_TEST_FILES= \
32 32
 	$(TEST_OUT_FILES) \
33 33
 	$(TEST_DATA_FILES)
34 34
 
35  
-EXTRA_DIST = $(ALL_TEST_FILES)
  35
+EXTRA_DIST = CMakeLists.txt $(ALL_TEST_FILES)
  36
+
  37
+CLEANFILES = CMakeTests.txt
36 38
 
37 39
 RAPPER = $(top_builddir)/utils/rapper
38 40
 
@@ -52,6 +54,7 @@ endif
52 54
 check-grddl: build-rapper $(check_grddl_deps)
53 55
 	@result=0; \
54 56
 	$(RECHO) "Testing GRDDL"; \
  57
+	printf 'IF(RAPTOR_PARSER_GRDDL)\n\n' >>CMakeTests.txt; \
55 58
 	for test in $(TEST_FILES); do \
56 59
 	  name=`basename $$test .html` ; \
57 60
 	  $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \
@@ -72,5 +75,11 @@ check-grddl: build-rapper $(check_grddl_deps)
72 75
 	  if test $$status != 1 ; then \
73 76
 	    rm -f $$name.res $$name.err; \
74 77
 	  fi; \
  78
+	  printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \
  79
+		grddl.$$name \
  80
+		"\$${RAPPER} -f noNet -q -i grddl -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \
  81
+		$$name.res \
  82
+		"\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \
75 83
 	done; \
  84
+	printf 'ENDIF(RAPTOR_PARSER_GRDDL)\n\n' >>CMakeTests.txt; \
76 85
 	exit $$result
69  tests/json/CMakeLists.txt
... ...
@@ -0,0 +1,69 @@
  1
+# raptor/tests/json/CMakeLists.txt
  2
+#
  3
+# Original listfile by Daniel Richard G. <skunk@iSKUNK.ORG>
  4
+# This file is in the public domain.
  5
+#
  6
+
  7
+IF(RAPTOR_PARSER_JSON)
  8
+
  9
+	RAPPER_TEST(json.example1
  10
+		"${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example1.json http://example.librdf.org/example1.json"
  11
+		example1.res
  12
+		${CMAKE_CURRENT_SOURCE_DIR}/example1.nt
  13
+	)
  14
+
  15
+	RAPPER_TEST(json.example2
  16
+		"${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example2.json http://example.librdf.org/example2.json"
  17
+		example2.res
  18
+		${CMAKE_CURRENT_SOURCE_DIR}/example2.nt
  19
+	)
  20
+
  21
+	RAPPER_TEST(json.example3
  22
+		"${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example3.json http://example.librdf.org/example3.json"
  23
+		example3.res
  24
+		${CMAKE_CURRENT_SOURCE_DIR}/example3.nt
  25
+	)
  26
+
  27
+	RAPPER_TEST(json.example4
  28
+		"${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example4.json http://example.librdf.org/example4.json"
  29
+		example4.res
  30
+		${CMAKE_CURRENT_SOURCE_DIR}/example4.nt
  31
+	)
  32
+
  33
+	ADD_TEST(json.bad-00 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-00.json http://example.librdf.org/bad-00.json) # WILL_FAIL
  34
+	ADD_TEST(json.bad-01 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-01.json http://example.librdf.org/bad-01.json) # WILL_FAIL
  35
+	ADD_TEST(json.bad-02 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-02.json http://example.librdf.org/bad-02.json) # WILL_FAIL
  36
+	ADD_TEST(json.bad-03 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-03.json http://example.librdf.org/bad-03.json) # WILL_FAIL
  37
+	ADD_TEST(json.bad-04 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-04.json http://example.librdf.org/bad-04.json) # WILL_FAIL
  38
+	ADD_TEST(json.bad-05 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-05.json http://example.librdf.org/bad-05.json) # WILL_FAIL
  39
+	ADD_TEST(json.bad-06 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-06.json http://example.librdf.org/bad-06.json) # WILL_FAIL
  40
+	ADD_TEST(json.bad-07 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-07.json http://example.librdf.org/bad-07.json) # WILL_FAIL
  41
+	ADD_TEST(json.bad-08 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-08.json http://example.librdf.org/bad-08.json) # WILL_FAIL
  42
+	ADD_TEST(json.bad-09 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-09.json http://example.librdf.org/bad-09.json) # WILL_FAIL
  43
+	ADD_TEST(json.bad-10 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-10.json http://example.librdf.org/bad-10.json) # WILL_FAIL
  44
+	ADD_TEST(json.bad-11 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-11.json http://example.librdf.org/bad-11.json) # WILL_FAIL
  45
+	ADD_TEST(json.bad-12 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-12.json http://example.librdf.org/bad-12.json) # WILL_FAIL
  46
+	ADD_TEST(json.bad-13 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-13.json http://example.librdf.org/bad-13.json) # WILL_FAIL
  47
+
  48
+	SET_TESTS_PROPERTIES(
  49
+		json.bad-00
  50
+		json.bad-01
  51
+		json.bad-02
  52
+		json.bad-03
  53
+		json.bad-04
  54
+		json.bad-05
  55
+		json.bad-06
  56
+		json.bad-07
  57
+		json.bad-08
  58
+		json.bad-09
  59
+		json.bad-10
  60
+		json.bad-11
  61
+		json.bad-12
  62
+		json.bad-13
  63
+		PROPERTIES
  64
+		WILL_FAIL TRUE
  65
+	)
  66
+
  67
+ENDIF(RAPTOR_PARSER_JSON)
  68
+
  69
+# end raptor/tests/json/CMakeLists.txt
20  tests/json/Makefile.am
@@ -34,12 +34,15 @@ bad-10.json bad-11.json bad-12.json bad-13.json
34 34
 BASE_URI=http://example.librdf.org/
35 35
 
36 36
 EXTRA_DIST = \
  37
+	CMakeLists.txt \
37 38
 	$(TEST_FILES) \
38 39
 	$(TEST_OUT_FILES) \
39 40
 	$(JSON_BAD_TEST_FILES)
40 41
 
41 42
 RAPPER = $(top_builddir)/utils/rapper
42 43
 
  44
+CLEANFILES = CMakeTests.txt CMakeTmp.txt
  45
+
43 46
 build-rapper:
44 47
 	@(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT))
45 48