comparison mupdf-source/thirdparty/tesseract/cmake/Configure.cmake @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
4 # http://www.apache.org/licenses/LICENSE-2.0
5 # Unless required by applicable law or agreed to in writing, software
6 # distributed under the License is distributed on an "AS IS" BASIS,
7 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8 # See the License for the specific language governing permissions and
9 # limitations under the License.
10 ################################################################################
11 #
12 # configure
13 #
14 ################################################################################
15
16 ########################################
17 # FUNCTION check_includes
18 ########################################
19 function(check_includes files)
20 foreach(F ${${files}})
21 set(name ${F})
22 string(REPLACE "-" "_" name ${name})
23 string(REPLACE "." "_" name ${name})
24 string(REPLACE "/" "_" name ${name})
25 string(TOUPPER ${name} name)
26 check_include_files(${F} HAVE_${name})
27 file(APPEND ${AUTOCONFIG_SRC} "/* Define to 1 if you have the <${F}> header file. */\n")
28 file(APPEND ${AUTOCONFIG_SRC} "#cmakedefine HAVE_${name} 1\n")
29 file(APPEND ${AUTOCONFIG_SRC} "\n")
30 endforeach()
31 endfunction(check_includes)
32
33 ########################################
34 # FUNCTION check_functions
35 ########################################
36 function(check_functions functions)
37 foreach(F ${${functions}})
38 set(name ${F})
39 string(TOUPPER ${name} name)
40 check_function_exists(${F} HAVE_${name})
41 file(APPEND ${AUTOCONFIG_SRC} "/* Define to 1 if you have the `${F}' function. */\n")
42 file(APPEND ${AUTOCONFIG_SRC} "#cmakedefine HAVE_${name} 1\n")
43 file(APPEND ${AUTOCONFIG_SRC} "\n")
44 endforeach()
45 endfunction(check_functions)
46
47 ########################################
48 # FUNCTION check_types
49 ########################################
50 function(check_types types)
51 foreach(T ${${types}})
52 set(name ${T})
53 string(REPLACE " " "_" name ${name})
54 string(REPLACE "-" "_" name ${name})
55 string(REPLACE "." "_" name ${name})
56 string(REPLACE "/" "_" name ${name})
57 string(TOUPPER ${name} name)
58 check_type_size(${T} HAVE_${name})
59 file(APPEND ${AUTOCONFIG_SRC} "/* Define to 1 if the system has the type `${T}'. */\n")
60 file(APPEND ${AUTOCONFIG_SRC} "#cmakedefine HAVE_${name} 1\n")
61 file(APPEND ${AUTOCONFIG_SRC} "\n")
62 endforeach()
63 endfunction(check_types)
64
65 ########################################
66
67 file(WRITE ${AUTOCONFIG_SRC})
68
69 include(CheckCSourceCompiles)
70 include(CheckCSourceRuns)
71 include(CheckCXXSourceCompiles)
72 include(CheckCXXSourceRuns)
73 include(CheckFunctionExists)
74 include(CheckIncludeFiles)
75 include(CheckLibraryExists)
76 include(CheckPrototypeDefinition)
77 include(CheckStructHasMember)
78 include(CheckSymbolExists)
79 include(CheckTypeSize)
80 include(TestBigEndian)
81
82 set(include_files_list
83 dlfcn.h
84 inttypes.h
85 memory.h
86 stdint.h
87 stdlib.h
88 string.h
89 sys/stat.h
90 sys/types.h
91 unistd.h
92
93 cairo/cairo-version.h
94 pango-1.0/pango/pango-features.h
95 unicode/uchar.h
96 )
97 # check_includes(include_files_list)
98
99 set(types_list
100 "long long int"
101 wchar_t
102 )
103 # check_types(types_list)
104
105 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
106 list(APPEND CMAKE_REQUIRED_LIBRARIES -lm)
107 set(functions_list
108 feenableexcept
109 )
110 check_functions(functions_list)
111
112 file(APPEND ${AUTOCONFIG_SRC} "
113 /* Version number */
114 #cmakedefine PACKAGE_VERSION \"${PACKAGE_VERSION}\"
115 #cmakedefine GRAPHICS_DISABLED ${GRAPHICS_DISABLED}
116 #cmakedefine FAST_FLOAT ${FAST_FLOAT}
117 #cmakedefine DISABLED_LEGACY_ENGINE ${DISABLED_LEGACY_ENGINE}
118 #cmakedefine HAVE_TIFFIO_H ${HAVE_TIFFIO_H}
119 #cmakedefine HAVE_NEON ${HAVE_NEON}
120 #cmakedefine HAVE_LIBARCHIVE ${HAVE_LIBARCHIVE}
121 #cmakedefine HAVE_LIBCURL ${HAVE_LIBCURL}
122 ")
123
124 if(TESSDATA_PREFIX)
125 file(APPEND ${AUTOCONFIG_SRC} "
126 #cmakedefine TESSDATA_PREFIX \"${TESSDATA_PREFIX}\"
127 ")
128 endif()
129
130 ########################################
131
132 ################################################################################