From b09a3c62dc80ea0c6c0a010c94c199d208e32f08 Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Thu, 1 Nov 2012 23:57:53 +0000 Subject: [PATCH] Sorted --- CMake.README | 111 ++++++++++ CMakeLists.txt | 586 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 697 insertions(+) create mode 100644 CMake.README create mode 100644 CMakeLists.txt diff --git a/CMake.README b/CMake.README new file mode 100644 index 00000000..f34012bb --- /dev/null +++ b/CMake.README @@ -0,0 +1,111 @@ + +Building Arabica with CMake +--------------------------- +Prerequisite: CMake 2.8 has to be installed and has to be in the PATH +The file "CMakeLists.txt" has to be in the root directory of the Arabica project. On the same level as AUTHORS, COPYING etc .. . + + +How to build on Windows: +----------------------- +1. Change to arabica root directory +2. Create a temporary build directory: mkdir build +3. Change into the build directory: cd build + +For a Visual Studio 2010 (32 bit) build do: +cmake -G "Visual Studio 2010" .. +A 32 bit solution "arabica.sln" will be generated in build. + +For a Visual Studio 2010 (64 bit) build do: +cmake -G "Visual Studio 2010 Win64" .. +A 64 bit solution "arabica.sln" will be generated in build. + +The default backend for a Windows build is MSXML. +To change the backend to EXPAT use: + +cmake -D ARABICA_XML_BACKEND=USE_EXPAT -G "Visual Studio 2010" .. +A 32 bit solution "arabica.sln" using expat backend will be generated in build. + + +How to build on Linux: +----------------------- +1. Change to arabica root directory +2. Create a temporary build directory: mkdir build +3. Change into the build directory: cd build + +For a Makefile build do: +cmake .. +A Makefile for arabica will be generated. (default using expat) + +cmake -D ARABICA_XML_BACKEND=USE_LIBXML2 .. +A Makefile for arabica usng libcml2 will be generated. + + + +Advanced options: +---------------- +Build arabica only without examples: +cmake -D BUILD_ARABICA_EXAMPLES=OFF .. + + + +Problems: +-------- +Boost was not found: +------------------- +Give the path to BOOST_ROOT using commandline: +cmake -DBOOST_ROOT=C:/BOOST .. + + +No find_package(XercesC)? +------------------------ +There is no official FindXercesC.cmake script in the CMake distribution. If needed I can send you the +one I have written for our project. + +Which other worskspaces can be generated by cmake? +------------------------------------------------- +Just run cmake without options and look at the list of available generators: +On Windows: +The following generators are available on this platform: + Borland Makefiles = Generates Borland makefiles. + MSYS Makefiles = Generates MSYS makefiles. + MinGW Makefiles = Generates a make file for use with + mingw32-make. + NMake Makefiles = Generates NMake makefiles. + NMake Makefiles JOM = Generates JOM makefiles. + Ninja = Generates build.ninja files (experimental). + Unix Makefiles = Generates standard UNIX makefiles. + Visual Studio 10 = Generates Visual Studio 10 project files. + Visual Studio 10 IA64 = Generates Visual Studio 10 Itanium project + files. + Visual Studio 10 Win64 = Generates Visual Studio 10 Win64 project + files. + Visual Studio 11 = Generates Visual Studio 11 project files. + Visual Studio 11 ARM = Generates Visual Studio 11 ARM project files. + Visual Studio 11 Win64 = Generates Visual Studio 11 Win64 project + files. + Visual Studio 6 = Generates Visual Studio 6 project files. + Visual Studio 7 = Generates Visual Studio .NET 2002 project + files. + Visual Studio 7 .NET 2003 = Generates Visual Studio .NET 2003 project + files. + Visual Studio 8 2005 = Generates Visual Studio .NET 2005 project + files. + Visual Studio 8 2005 Win64 = Generates Visual Studio .NET 2005 Win64 + project files. + Visual Studio 9 2008 = Generates Visual Studio 9 2008 project files. + Visual Studio 9 2008 IA64 = Generates Visual Studio 9 2008 Itanium + project files. + Visual Studio 9 2008 Win64 = Generates Visual Studio 9 2008 Win64 project + files. + Watcom WMake = Generates Watcom WMake makefiles. + CodeBlocks - MinGW Makefiles= Generates CodeBlocks project files. + CodeBlocks - NMake Makefiles= Generates CodeBlocks project files. + CodeBlocks - Ninja = Generates CodeBlocks project files. + CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. + Eclipse CDT4 - MinGW Makefiles + = Generates Eclipse CDT 4.0 project files. + Eclipse CDT4 - NMake Makefiles + = Generates Eclipse CDT 4.0 project files. + Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. + Eclipse CDT4 - Unix Makefiles + = Generates Eclipse CDT 4.0 project files. \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..fb52b9ff --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,586 @@ +# +# CMakeLists.txt file for arabica xml +# author: Gunther Laure +# + +cmake_minimum_required (VERSION 2.8) + +project(arabica) + +set(LIBNAME arabica) + +# +# Enable/Disable example build +# +option(BUILD_ARABICA_EXAMPLES "Build all arabica examples" ON) + + +# +# Enable target folders in Visual Studio and other IDEs +set_property(GLOBAL + PROPERTY USE_FOLDERS ON) + + +# +# Set the used xml backend +# options: USE_MSXML, USE_EXPAT, USE_LIBXML2, USE_XERCES +# default for windows: MSXML +# default for linux: EXPAT +if(NOT ARABICA_XML_BACKEND) + if(WIN32) + set(ARABICA_XML_BACKEND USE_MSXML) +else() + set(ARABICA_XML_BACKEND USE_EXPAT) + endif() +endif() + +# +# Find boost +if(NOT TARGET boost) + ## BOOST_ROOT has to be set correctly + if(NOT DEFINED BOOST_ROOT) + set(BOOST_ROOT "../boost") # reasonable default: boost is in a parallel directory + endif() + find_package(Boost) +endif() + +# +# Find expat +if(ARABICA_XML_BACKEND STREQUAL USE_EXPAT) + if(NOT TARGET expat) + find_package(EXPAT REQUIRED) + set(ADDITIONAL_INC ${EXPAT_INCLUDE_DIRS}) + set(ADDITIONAL_LIB ${EXPAT_LIBRARY}) + else() + # set externally + set(ADDITIONAL_INC ${EXPAT_INCLUDE_DIRS}) + set(ADDITIONAL_LIB expat) + endif() +endif() + +# +# find libxml2: LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES +if(ARABICA_XML_BACKEND STREQUAL USE_LIBXML2) + find_package(LibXml2) + set(ADDITIONAL_INC ${LIBXML2_INCLUDE_DIR}) + set(ADDITIONAL_LIB ${LIBXML2_LIBRARIES}) +endif() + + +# +# platform check +# +# Check for 64 bit build +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(BUILD_X64 TRUE) + set(BUILD_X86 FALSE) +else() + set(BUILD_X64 FALSE) + set(BUILD_X86 TRUE) +endif() + + +if(BUILD_ARABICA_EXAMPLES) + message(STATUS "Building ${LIBNAME} with ${ARABICA_XML_BACKEND} compile flag with examples") +else() + message(STATUS "Building ${LIBNAME} with ${ARABICA_XML_BACKEND} compile flag library only") +endif() + + +include_directories ( + SYSTEM + ${ADDITIONAL_INC} + ${Boost_INCLUDE_DIRS} + ) + +include_directories ( + include + ) + + +# +# configuration input file +set(ARABICA_CONFIG_FILE + vs7/ArabicaConfig.S +) +source_group("Config Input" FILES ${ARABICA_CONFIG_FILE}) + +set(GENERATED_HEADER_FILES + include/SAX/ArabicaConfig.hpp +) +source_group("Generated Header Files" FILES ${GENERATED_HEADER_FILES}) + +set(PUBLIC_HEADER_FILES + include/SAX/AttributeList.hpp + include/SAX/Attributes.hpp + include/SAX/ContentHandler.hpp + include/SAX/DocumentHandler.hpp + include/SAX/DTDHandler.hpp + include/SAX/EntityResolver.hpp + include/SAX/ErrorHandler.hpp + include/SAX/HandlerBase.hpp + include/SAX/InputSource.hpp + include/SAX/IStreamHandle.hpp + include/SAX/Locator.hpp + include/SAX/Parser.hpp + include/SAX/ParserConfig.hpp + include/SAX/SAXException.hpp + include/SAX/saxfwd.hpp + include/SAX/SAXNotRecognizedException.hpp + include/SAX/SAXNotSupportedException.hpp + include/SAX/SAXParseException.hpp + include/SAX/XMLFilter.hpp + include/SAX/XMLReader.hpp + include/SAX/ext/Attributes2.hpp + include/SAX/ext/DeclHandler.hpp + include/SAX/ext/DefaultHandler2.hpp + include/SAX/ext/LexicalHandler.hpp + include/SAX/ext/Locator2.hpp + include/SAX/ext/ProgressiveParser.hpp + include/SAX/filter/NamespaceTracker.hpp + include/SAX/filter/TextCoalescer.hpp + include/SAX/filter/TextOnly.hpp + include/SAX/filter/Writer.hpp + include/SAX/filter/XMLBaseTracker.hpp + include/SAX/helpers/AttributeDefaults.hpp + include/SAX/helpers/AttributeListImpl.hpp + include/SAX/helpers/AttributesImpl.hpp + include/SAX/helpers/AttributeTypes.hpp + include/SAX/helpers/CatchErrorHandler.hpp + include/SAX/helpers/DefaultHandler.hpp + include/SAX/helpers/FeatureNames.hpp + include/SAX/helpers/InputSourceResolver.hpp + include/SAX/helpers/LocatorImpl.hpp + include/SAX/helpers/NamespaceSupport.hpp + include/SAX/helpers/ParserAdaptor.hpp + include/SAX/helpers/PropertyNames.hpp + include/SAX/helpers/XMLBaseSupport.hpp + include/SAX/helpers/XMLFilterImpl.hpp + include/SAX/parsers/saxgarden.hpp + include/SAX/wrappers/saxexpat.hpp + include/SAX/wrappers/saxlibxml2.hpp + include/SAX/wrappers/saxmsxml2.hpp + include/SAX/wrappers/saxxerces.hpp + include/SAX/wrappers/XercesFeatureNames.hpp + include/SAX/wrappers/XercesPropertyNames.hpp + include/DOM/Attr.hpp + include/DOM/CDATASection.hpp + include/DOM/CharacterData.hpp + include/DOM/Comment.hpp + include/DOM/Document.hpp + include/DOM/DocumentFragment.hpp + include/DOM/DocumentType.hpp + include/DOM/DOMException.hpp + include/DOM/DOMImplementation.hpp + include/DOM/Element.hpp + include/DOM/Entity.hpp + include/DOM/EntityReference.hpp + include/DOM/NamedNodeMap.hpp + include/DOM/Node.hpp + include/DOM/NodeList.hpp + include/DOM/Notation.hpp + include/DOM/ProcessingInstruction.hpp + include/DOM/Proxy.hpp + include/DOM/Text.hpp + include/DOM/DualMode/DualMode.hpp + include/DOM/Events/DocumentEvent.hpp + include/DOM/Events/Event.hpp + include/DOM/Events/EventException.hpp + include/DOM/Events/EventListener.hpp + include/DOM/Events/EventTarget.hpp + include/DOM/Events/MutationEvent.hpp + include/DOM/SAX2DOM/DocumentTypeImpl.hpp + include/DOM/SAX2DOM/SAX2DOM.hpp + include/DOM/Simple/AttrImpl.hpp + include/DOM/Simple/AttrMap.hpp + include/DOM/Simple/AttrNSImpl.hpp + include/DOM/Simple/CDATASectionImpl.hpp + include/DOM/Simple/CharacterDataImpl.hpp + include/DOM/Simple/CommentImpl.hpp + include/DOM/Simple/DocumentFragmentImpl.hpp + include/DOM/Simple/DocumentImpl.hpp + include/DOM/Simple/DocumentTypeImpl.hpp + include/DOM/Simple/DOMImplementation.hpp + include/DOM/Simple/ElementByTagImpl.hpp + include/DOM/Simple/ElementImpl.hpp + include/DOM/Simple/ElementNSImpl.hpp + include/DOM/Simple/EntityImpl.hpp + include/DOM/Simple/EntityReferenceImpl.hpp + include/DOM/Simple/Helpers.hpp + include/DOM/Simple/NamedNodeMapImpl.hpp + include/DOM/Simple/NodeImpl.hpp + include/DOM/Simple/NotationImpl.hpp + include/DOM/Simple/ProcessingInstructionImpl.hpp + include/DOM/Simple/TextImpl.hpp + include/DOM/Traversal/DocumentTraversal.hpp + include/DOM/Traversal/DocumentTraversalImpl.hpp + include/DOM/Traversal/NodeFilter.hpp + include/DOM/Traversal/NodeIterator.hpp + include/DOM/Traversal/TraversalImpl.hpp + include/DOM/Traversal/TreeWalker.hpp + include/DOM/Traversal/TreeWalkerImpl.hpp + include/DOM/io/Stream.hpp + include/XPath/XPath.hpp + include/XPath/impl/xpath_arithmetic.hpp + include/XPath/impl/xpath_ast.hpp + include/XPath/impl/xpath_ast_ids.hpp + include/XPath/impl/xpath_axis_enumerator.hpp + include/XPath/impl/xpath_compile_context.hpp + include/XPath/impl/xpath_execution_context.hpp + include/XPath/impl/xpath_expression.hpp + include/XPath/impl/xpath_expression_impl.hpp + include/XPath/impl/xpath_function.hpp + include/XPath/impl/xpath_function_holder.hpp + include/XPath/impl/xpath_function_resolver.hpp + include/XPath/impl/xpath_grammar.hpp + include/XPath/impl/xpath_logical.hpp + include/XPath/impl/xpath_match.hpp + include/XPath/impl/xpath_match_rewrite.hpp + include/XPath/impl/xpath_namespace_context.hpp + include/XPath/impl/xpath_namespace_node.hpp + include/XPath/impl/xpath_node_test.hpp + include/XPath/impl/xpath_object.hpp + include/XPath/impl/xpath_parser.hpp + include/XPath/impl/xpath_relational.hpp + include/XPath/impl/xpath_resolver_holder.hpp + include/XPath/impl/xpath_step.hpp + include/XPath/impl/xpath_union.hpp + include/XPath/impl/xpath_value.hpp + include/XPath/impl/xpath_variable.hpp + include/XPath/impl/xpath_variable_resolver.hpp + include/Arabica/getparam.hpp + include/Arabica/StringAdaptor.hpp + include/Arabica/stringadaptortag.hpp + include/XML/escaper.hpp + include/XML/QName.hpp + include/XML/strings.hpp + include/XML/XMLCharacterClasses.hpp + include/io/convert_adaptor.hpp + include/io/convertstream.hpp + include/io/socket_stream.hpp + include/io/uri.hpp + include/convert/base64codecvt.hpp + include/convert/impl/codecvt_specialisations.hpp + include/convert/impl/iso88591_utf8.hpp + include/convert/iso88591utf8codecvt.hpp + include/convert/rot13codecvt.hpp + include/convert/impl/ucs2_utf16.hpp + include/convert/impl/ucs2_utf8.hpp + include/convert/ucs2utf8codecvt.hpp + include/convert/utf16beucs2codecvt.hpp + include/convert/utf16leucs2codecvt.hpp + include/convert/utf16utf8codecvt.hpp + include/convert/utf8iso88591codecvt.hpp + include/convert/utf8ucs2codecvt.hpp + include/text/normalize_whitespace.hpp + include/text/UnicodeCharacters.hpp + include/Taggle/impl/Element.hpp + include/Taggle/impl/ElementType.hpp + include/Taggle/impl/html/HTMLModels.hpp + include/Taggle/impl/html/HTMLScanner.hpp + include/Taggle/impl/html/HTMLSchema.hpp + include/Taggle/impl/Parser.hpp + include/Taggle/impl/ScanHandler.hpp + include/Taggle/impl/Scanner.hpp + include/Taggle/impl/Schema.hpp + include/Taggle/impl/SchemaImpl.hpp + include/Taggle/Taggle.hpp + include/XSLT/XSLT.hpp + include/XSLT/impl/xslt_apply_imports.hpp + include/XSLT/impl/xslt_apply_templates.hpp + include/XSLT/impl/xslt_attribute.hpp + include/XSLT/impl/xslt_call_template.hpp + include/XSLT/impl/xslt_choose.hpp + include/XSLT/impl/xslt_comment.hpp + include/XSLT/impl/xslt_compilation_context.hpp + include/XSLT/impl/xslt_compiled_stylesheet.hpp + include/XSLT/impl/xslt_copy.hpp + include/XSLT/impl/xslt_element.hpp + include/XSLT/impl/xslt_execution_context.hpp + include/XSLT/impl/xslt_for_each.hpp + include/XSLT/impl/xslt_functions.hpp + include/XSLT/impl/xslt_if.hpp + include/XSLT/impl/xslt_inline_element.hpp + include/XSLT/impl/xslt_item.hpp + include/XSLT/impl/xslt_key.hpp + include/XSLT/impl/xslt_message.hpp + include/XSLT/impl/xslt_namespace_stack.hpp + include/XSLT/impl/xslt_output.hpp + include/XSLT/impl/xslt_param.hpp + include/XSLT/impl/xslt_precedence.hpp + include/XSLT/impl/xslt_processing_instruction.hpp + include/XSLT/impl/xslt_qname.hpp + include/XSLT/impl/xslt_sink.hpp + include/XSLT/impl/xslt_sort.hpp + include/XSLT/impl/xslt_stylesheet.hpp + include/XSLT/impl/xslt_stylesheet_compiler.hpp + include/XSLT/impl/xslt_stylesheet_parser.hpp + include/XSLT/impl/xslt_template.hpp + include/XSLT/impl/xslt_text.hpp + include/XSLT/impl/xslt_top_level_param.hpp + include/XSLT/impl/xslt_value_of.hpp + include/XSLT/impl/xslt_variable.hpp + include/XSLT/impl/xslt_variable_impl.hpp + include/XSLT/impl/xslt_variable_stack.hpp + include/XSLT/impl/xslt_with_param.hpp + include/XSLT/impl/handler/xslt_apply_imports_handler.hpp + include/XSLT/impl/handler/xslt_apply_templates_handler.hpp + include/XSLT/impl/handler/xslt_attribute_handler.hpp + include/XSLT/impl/handler/xslt_call_template_handler.hpp + include/XSLT/impl/handler/xslt_choose_handler.hpp + include/XSLT/impl/handler/xslt_comment_handler.hpp + include/XSLT/impl/handler/xslt_constants.hpp + include/XSLT/impl/handler/xslt_copy_handler.hpp + include/XSLT/impl/handler/xslt_create_handler.hpp + include/XSLT/impl/handler/xslt_element_handler.hpp + include/XSLT/impl/handler/xslt_for_each_handler.hpp + include/XSLT/impl/handler/xslt_if_handler.hpp + include/XSLT/impl/handler/xslt_include_handler.hpp + include/XSLT/impl/handler/xslt_inline_element_handler.hpp + include/XSLT/impl/handler/xslt_item_container_handler.hpp + include/XSLT/impl/handler/xslt_key_handler.hpp + include/XSLT/impl/handler/xslt_message_handler.hpp + include/XSLT/impl/handler/xslt_namespace_alias_handler.hpp + include/XSLT/impl/handler/xslt_output_handler.hpp + include/XSLT/impl/handler/xslt_processing_instruction_handler.hpp + include/XSLT/impl/handler/xslt_sort_handler.hpp + include/XSLT/impl/handler/xslt_template_handler.hpp + include/XSLT/impl/handler/xslt_text_handler.hpp + include/XSLT/impl/handler/xslt_value_of_handler.hpp + include/XSLT/impl/handler/xslt_value_validation.hpp + include/XSLT/impl/handler/xslt_variable_handler.hpp + include/XSLT/impl/handler/xslt_with_param_handler.hpp + ) +source_group("Header Files" FILES ${PUBLIC_HEADER_FILES}) + +set(SOURCE_FILES + src/arabica.cpp + src/XML/XMLCharacterClasses.cpp + src/SAX/helpers/InputSourceResolver.cpp + src/io/uri.cpp + src/convert/base64codecvt.cpp + src/convert/impl/iso88591_utf8.cpp + src/convert/iso88591utf8codecvt.cpp + src/convert/rot13codecvt.cpp + src/convert/impl/ucs2_utf16.cpp + src/convert/impl/ucs2_utf8.cpp + src/convert/ucs2utf8codecvt.cpp + src/convert/utf16beucs2codecvt.cpp + src/convert/utf16leucs2codecvt.cpp + src/convert/utf16utf8codecvt.cpp + src/convert/utf8iso88591codecvt.cpp + src/convert/utf8ucs2codecvt.cpp + src/taggle/Schema.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + + +add_library (${LIBNAME} STATIC + ${ARABICA_CONFIG_FILE} + ${GENERATED_HEADER_FILES} + ${PUBLIC_HEADER_FILES} + ${SOURCE_FILES} +) + + +set_property(TARGET ${LIBNAME} + APPEND + PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + +set_source_files_properties(${ARABICA_CONFIG_FILE} PROPERTIES HEADER_FILE_ONLY TRUE) + + +# +# Configure XML backend +if(MSVC) + # + # Preprocess configuration file for windows + add_custom_command(OUTPUT include/SAX/ArabicaConfig.hpp + COMMAND ${CMAKE_CXX_COMPILER} /TC /EP -D ${ARABICA_XML_BACKEND} ${CMAKE_CURRENT_LIST_DIR}/${ARABICA_CONFIG_FILE} > ${CMAKE_CURRENT_LIST_DIR}/include/SAX/ArabicaConfig.hpp + ) +else() + # + # Preprocess configuration file for Linux/GCC + message("${CMAKE_CXX_COMPILER} -E -D ${ARABICA_XML_BACKEND} -D NO_WINDOWS ${CMAKE_CURRENT_LIST_DIR}/${ARABICA_CONFIG_FILE} -o ${CMAKE_CURRENT_LIST_DIR}/include/SAX/ArabicaConfig.hpps") + + add_custom_command(OUTPUT include/SAX/ArabicaConfig.hpp + COMMAND ${CMAKE_CXX_COMPILER} -E -D ${ARABICA_XML_BACKEND} -D NO_WINDOWS ${CMAKE_CURRENT_LIST_DIR}/${ARABICA_CONFIG_FILE} -o ${CMAKE_CURRENT_LIST_DIR}/include/SAX/ArabicaConfig.hpp + ) +endif() + + + +# VS2010 bug for 64bit builds +if(MSVC) + if(BUILD_X64) + set_property(TARGET ${LIBNAME} + APPEND + PROPERTY STATIC_LIBRARY_FLAGS + /MACHINE:X64 + ) + endif() +endif() + + +if(MSVC) + # link socket library in windows + target_link_libraries(${LIBNAME} + ws2_32.lib + ) +endif() + +# link chosen backend +target_link_libraries(${LIBNAME} + ${ADDITIONAL_LIB} +) + + +# +# Add build dependency to boost if boost is part of the same project +if(TARGET boost) + add_dependencies(${LIBNAME} boost) +endif() + +set_target_properties(${LIBNAME} PROPERTIES FOLDER "3rdparty/arabica") + + +if(BUILD_ARABICA_EXAMPLES) + + # + # Example Dom writer: + set(EXAMPLE_NAME dom_writer) + add_executable(${EXAMPLE_NAME} examples/DOM/DOMWriter.cpp) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example SAX pyx: + set(EXAMPLE_NAME pyx) + add_executable(${EXAMPLE_NAME} examples/SAX/pyx.cpp) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example SAX simple handler: + set(EXAMPLE_NAME simplehandler) + set(SIMPLE_HANDLER_SOURCES + examples/SAX/SimpleHandler.cpp + examples/SAX/SimpleHandler.hpp + examples/SAX/wrapper.cpp + ) + add_executable(${EXAMPLE_NAME} ${SIMPLE_HANDLER_SOURCES}) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example SAX taggle: + set(EXAMPLE_NAME taggle) + add_executable(${EXAMPLE_NAME} examples/Taggle/taggle.cpp) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example SAX writer: + set(EXAMPLE_NAME writer) + add_executable(${EXAMPLE_NAME} examples/SAX/writer.cpp) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example SAX xmlbase: + set(EXAMPLE_NAME xmlbase) + add_executable(${EXAMPLE_NAME} examples/SAX/xmlbase.cpp) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example SAX transcode: + set(EXAMPLE_NAME transcode) + add_executable(${EXAMPLE_NAME} examples/Utils/transcode.cpp) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example SAX xgrep: + set(EXAMPLE_NAME xgrep) + add_executable(${EXAMPLE_NAME} examples/XPath/xgrep.cpp) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + + # + # Example XSLT xgrep: + set(EXAMPLE_NAME mangle) + add_executable(${EXAMPLE_NAME} examples/XSLT/mangle.cpp) + + # + # win32 disable incremental linking + if(WIN32) + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_FLAGS + "/bigobj" + ) + endif() + + set_property(TARGET ${EXAMPLE_NAME} + APPEND PROPERTY COMPILE_DEFINITIONS + ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS + ) + target_link_libraries(${EXAMPLE_NAME} + arabica + ) + set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "3rdparty/arabica_examples") + +endif() + +