expat-config.cmake 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # __ __ _
  2. # ___\ \/ /_ __ __ _| |_
  3. # / _ \\ /| '_ \ / _` | __|
  4. # | __// \| |_) | (_| | |_
  5. # \___/_/\_\ .__/ \__,_|\__|
  6. # |_| XML parser
  7. #
  8. # Copyright (c) 2019 Expat development team
  9. # Licensed under the MIT license:
  10. #
  11. # Permission is hereby granted, free of charge, to any person obtaining
  12. # a copy of this software and associated documentation files (the
  13. # "Software"), to deal in the Software without restriction, including
  14. # without limitation the rights to use, copy, modify, merge, publish,
  15. # distribute, sublicense, and/or sell copies of the Software, and to permit
  16. # persons to whom the Software is furnished to do so, subject to the
  17. # following conditions:
  18. #
  19. # The above copyright notice and this permission notice shall be included
  20. # in all copies or substantial portions of the Software.
  21. #
  22. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  25. # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  26. # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  27. # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  28. # USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. #
  30. if(NOT _expat_config_included)
  31. # Protect against multiple inclusion
  32. set(_expat_config_included TRUE)
  33. include("${CMAKE_CURRENT_LIST_DIR}/expat.cmake")
  34. ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
  35. ####### Any changes to this file will be overwritten by the next CMake run ####
  36. ####### The input file was expat-config.cmake.in ########
  37. get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
  38. macro(set_and_check _var _file)
  39. set(${_var} "${_file}")
  40. if(NOT EXISTS "${_file}")
  41. message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  42. endif()
  43. endmacro()
  44. macro(check_required_components _NAME)
  45. foreach(comp ${${_NAME}_FIND_COMPONENTS})
  46. if(NOT ${_NAME}_${comp}_FOUND)
  47. if(${_NAME}_FIND_REQUIRED_${comp})
  48. set(${_NAME}_FOUND FALSE)
  49. endif()
  50. endif()
  51. endforeach()
  52. endmacro()
  53. ####################################################################################
  54. #
  55. # Supported components
  56. #
  57. macro(expat_register_component _NAME _AVAILABE)
  58. set(expat_${_NAME}_FOUND ${_AVAILABE})
  59. endmacro()
  60. expat_register_component(attr_info OFF)
  61. expat_register_component(dtd ON)
  62. expat_register_component(large_size OFF)
  63. expat_register_component(min_size OFF)
  64. expat_register_component(ns ON)
  65. if(1024)
  66. expat_register_component(context_bytes ON)
  67. else()
  68. expat_register_component(context_bytes OFF)
  69. endif()
  70. if("char" STREQUAL "char")
  71. expat_register_component(char ON)
  72. expat_register_component(ushort OFF)
  73. expat_register_component(wchar_t OFF)
  74. elseif("char" STREQUAL "ushort")
  75. expat_register_component(char OFF)
  76. expat_register_component(ushort ON)
  77. expat_register_component(wchar_t OFF)
  78. elseif("char" STREQUAL "wchar_t")
  79. expat_register_component(char OFF)
  80. expat_register_component(ushort OFF)
  81. expat_register_component(wchar_t ON)
  82. endif()
  83. check_required_components(expat)
  84. endif(NOT _expat_config_included)