Simple XML subset parser comparable to glib's Markup parser, but without any dependencies in one self contained file. Forked from https://github.com/ooxi/xml.c
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

56 linhas
1.1 KiB

  1. # Project setup
  2. PROJECT(xml)
  3. SET(VERSION_MAJOR "0")
  4. SET(VERSION_MINOR "1")
  5. SET(VERSION_PATCH "4")
  6. CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
  7. # Compiler setup
  8. SET(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG")
  9. SET(CMAKE_C_FLAGS_RELEASE "-O2")
  10. # Options
  11. OPTION(XML_PARSER_VERBOSE "Enable to be told everything the xml parser does" OFF)
  12. IF(XML_PARSER_VERBOSE)
  13. ADD_DEFINITIONS(-DXML_PARSER_VERBOSE)
  14. ENDIF(XML_PARSER_VERBOSE)
  15. # Sources
  16. SET(SOURCE_DIRECTORY src)
  17. SET(TEST_SOURCE_DIRECTORY test)
  18. # Build library
  19. ADD_LIBRARY(xml STATIC
  20. ${SOURCE_DIRECTORY}/xml.c
  21. )
  22. # Build unit cases
  23. INCLUDE_DIRECTORIES(${SOURCE_DIRECTORY})
  24. ADD_EXECUTABLE(test-xml-c
  25. ${TEST_SOURCE_DIRECTORY}/test-xml-c
  26. )
  27. TARGET_LINK_LIBRARIES(test-xml-c xml)
  28. ADD_EXECUTABLE(test-xml-cpp
  29. ${TEST_SOURCE_DIRECTORY}/test-xml-cpp
  30. )
  31. TARGET_LINK_LIBRARIES(test-xml-cpp xml)
  32. FILE( COPY ${TEST_SOURCE_DIRECTORY}/test.xml
  33. DESTINATION ${PROJECT_BINARY_DIR}
  34. )
  35. # Building example
  36. ADD_EXECUTABLE(example
  37. ${TEST_SOURCE_DIRECTORY}/example
  38. )
  39. TARGET_LINK_LIBRARIES(example xml)