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