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
Você não pode selecionar mais de 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.

CMakeLists.txt 1.5 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # xml.c / test
  2. cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
  3. # Example
  4. add_executable(
  5. "${PROJECT_NAME}-example"
  6. "${CMAKE_CURRENT_LIST_DIR}/example.c"
  7. )
  8. target_compile_options(
  9. "${PROJECT_NAME}-example"
  10. PRIVATE
  11. -std=c11
  12. )
  13. target_link_libraries(
  14. "${PROJECT_NAME}-example"
  15. PRIVATE
  16. xml
  17. )
  18. add_test(
  19. NAME "${PROJECT_NAME}-example"
  20. COMMAND "${PROJECT_NAME}-example"
  21. )
  22. # Test case
  23. FILE( COPY "${CMAKE_CURRENT_LIST_DIR}/test.xml"
  24. DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
  25. )
  26. # Test (C)
  27. add_executable(
  28. "${PROJECT_NAME}-test-c"
  29. "${CMAKE_CURRENT_LIST_DIR}/test-xml-c.c"
  30. )
  31. target_compile_options(
  32. "${PROJECT_NAME}-test-c"
  33. PRIVATE
  34. -std=c11
  35. )
  36. target_link_libraries(
  37. "${PROJECT_NAME}-test-c"
  38. PRIVATE
  39. xml
  40. )
  41. add_test(
  42. NAME "${PROJECT_NAME}-test-c"
  43. COMMAND "${PROJECT_NAME}-test-c"
  44. )
  45. add_test(
  46. NAME "${PROJECT_NAME}-test-c-valgrind"
  47. COMMAND valgrind --tool=memcheck --leak-check=full --track-origins=yes -v "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-test-c"
  48. )
  49. # Test (C++)
  50. add_executable(
  51. "${PROJECT_NAME}-test-cpp"
  52. "${CMAKE_CURRENT_LIST_DIR}/test-xml-cpp.cpp"
  53. )
  54. target_compile_options(
  55. "${PROJECT_NAME}-test-cpp"
  56. PRIVATE
  57. -std=c++11
  58. )
  59. target_link_libraries(
  60. "${PROJECT_NAME}-test-cpp"
  61. PRIVATE
  62. xml
  63. )
  64. add_test(
  65. NAME "${PROJECT_NAME}-test-cpp"
  66. COMMAND "${PROJECT_NAME}-test-cpp"
  67. )
  68. add_test(
  69. NAME "${PROJECT_NAME}-test-cpp-valgrind"
  70. COMMAND valgrind --tool=memcheck --leak-check=full --track-origins=yes -v "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-test-cpp"
  71. )