Rev 24986 | Rev 25180 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23128 | craig | 1 | ############################################################################################################## |
2 | ########## Find Dependencies ########## |
||
3 | |||
4 | #<< Qt |
||
5 | set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake") |
||
6 | set(CMAKE_INCLUDE_CURRENT_DIR ON) |
||
24314 | craig | 7 | |
24858 | craig | 8 | set(QT_MIN_VERSION "6.2.0") |
24314 | craig | 9 | |
24858 | craig | 10 | find_package(Qt6 COMPONENTS Core REQUIRED) |
11 | add_definitions(${Qt6Core_DEFINITIONS}) |
||
12 | include_directories(${Qt6Core_INCLUDE_DIRS}) |
||
24734 | craig | 13 | |
24858 | craig | 14 | find_package(Qt6 COMPONENTS Core5Compat REQUIRED) |
15 | include_directories(${Qt6Core5Compat_INCLUDE_DIRS}) |
||
16 | add_definitions(${Qt6Core5Compat_DEFINITIONS}) |
||
24651 | craig | 17 | |
24858 | craig | 18 | find_package(Qt6 COMPONENTS Gui REQUIRED) |
19 | include_directories(${Qt6Gui_INCLUDE_DIRS}) |
||
20 | add_definitions(${Qt6Gui_DEFINITIONS}) |
||
24651 | craig | 21 | |
24858 | craig | 22 | find_package(Qt6 COMPONENTS Widgets REQUIRED) |
23 | include_directories(${Qt6Widgets_INCLUDE_DIRS}) |
||
24 | add_definitions(${Qt6Widgets_DEFINITIONS}) |
||
24651 | craig | 25 | |
24858 | craig | 26 | find_package(Qt6 COMPONENTS Network REQUIRED) |
27 | include_directories(${Qt6Network_INCLUDE_DIRS}) |
||
28 | add_definitions(${Qt6Network_DEFINITIONS}) |
||
24651 | craig | 29 | |
24858 | craig | 30 | find_package(Qt6 COMPONENTS OpenGL REQUIRED) |
31 | include_directories(${Qt6OpenGL_INCLUDE_DIRS}) |
||
32 | add_definitions(${Qt6OpenGL_DEFINITIONS}) |
||
24651 | craig | 33 | |
24858 | craig | 34 | find_package(Qt6 COMPONENTS PrintSupport REQUIRED) |
35 | include_directories(${Qt6PrintSupport_INCLUDE_DIRS}) |
||
36 | add_definitions(${Qt6PrintSupport_DEFINITIONS}) |
||
24854 | craig | 37 | |
24858 | craig | 38 | find_package(Qt6 COMPONENTS Xml REQUIRED) |
39 | include_directories(${Qt6Xml_INCLUDE_DIRS}) |
||
40 | add_definitions(${Qt6Xml_DEFINITIONS}) |
||
24854 | craig | 41 | |
24858 | craig | 42 | find_package(Qt6 COMPONENTS LinguistTools REQUIRED) |
43 | include_directories(${Qt6LinguistTools_INCLUDE_DIRS}) |
||
44 | add_definitions(${Qt6LinguistTools_DEFINITIONS}) |
||
24854 | craig | 45 | |
24858 | craig | 46 | message(STATUS "Qt Version Found: ${Qt6Widgets_VERSION}") |
24651 | craig | 47 | |
23128 | craig | 48 | |
24858 | craig | 49 | #<<PNG |
23128 | craig | 50 | if (WIN32) |
51 | # On win32 we can use Qt's zlib and libpng, so we use some |
||
52 | # custom cmake includes. This permits us to honour the |
||
53 | # USE_QT_ZLIB_PNGLIB flag if passed. |
||
54 | set(PNG_DIR ${CMAKE_MODULE_PATH}) |
||
55 | set(ZLIB_DIR ${CMAKE_MODULE_PATH}) |
||
56 | endif() |
||
24858 | craig | 57 | #>> PNG |
58 | #<< ZLIB |
||
23128 | craig | 59 | find_package(ZLIB REQUIRED) |
60 | if (ZLIB_FOUND) |
||
61 | message("ZLIB Library Found OK") |
||
62 | set(HAVE_LIBZ ON) |
||
63 | endif() |
||
24858 | craig | 64 | #>> ZLIB |
23128 | craig | 65 | |
66 | if (WANT_NOOSG) |
||
67 | message("Building without 3D Extension") |
||
68 | else() |
||
69 | find_package(OSG) |
||
70 | if(OSG_FOUND) |
||
71 | message("OSG found OK") |
||
72 | set(HAVE_OSG ON) |
||
73 | find_package(OpenGL) |
||
74 | include(CheckFunctionExists) |
||
75 | CHECK_FUNCTION_EXISTS(memrchr HAVE_MEMRCHR) |
||
76 | else() |
||
77 | message("No OSG found, building without 3D Extension") |
||
78 | endif() |
||
79 | endif() |
||
80 | |||
23489 | jghali | 81 | #<< JPEG, PNG, TIFF |
23128 | craig | 82 | find_package(JPEG REQUIRED) |
83 | if (JPEG_FOUND) |
||
84 | message("JPEG Library Found OK") |
||
85 | endif() |
||
23489 | jghali | 86 | |
87 | find_package(PNG 1.6 REQUIRED) |
||
88 | if (PNG_FOUND) |
||
89 | message("PNG Library Found OK") |
||
90 | endif() |
||
91 | |||
23128 | craig | 92 | find_package(TIFF REQUIRED) |
93 | if (TIFF_FOUND) |
||
94 | message("TIFF Library Found OK") |
||
95 | set(HAVE_TIFF ON) |
||
96 | else() |
||
97 | message(FATAL_ERROR "Could not find the TIFF Library") |
||
98 | endif() |
||
99 | #<< JPEG, TIFF |
||
100 | |||
101 | #<< PYTHON |
||
24858 | craig | 102 | message("Python 3.x Selected") |
103 | find_package (Python3 REQUIRED COMPONENTS Interpreter Development) |
||
104 | if (Python3_Development_FOUND) |
||
105 | message("Python 3.x Library Found OK (Version ${Python3_VERSION})") |
||
106 | message("Interpreter: ${Python3_EXECUTABLE}") |
||
107 | message("Include directories: ${Python3_INCLUDE_DIRS}") |
||
108 | message("Library directories: ${Python3_LIBRARY_DIRS}") |
||
109 | message("Runtime library directories: ${Python3_RUNTIME_LIBRARY_DIRS}") |
||
110 | set(HAVE_PYTHON ON) |
||
23128 | craig | 111 | endif() |
112 | #>> PYTHON |
||
113 | |||
114 | #<< FreeType2 |
||
115 | find_package(Freetype REQUIRED) |
||
116 | if (FREETYPE_FOUND) |
||
117 | message(STATUS "FreeType2 Library Found OK") |
||
118 | else() |
||
119 | message(FATAL_ERROR "No Freetype Found") |
||
120 | endif() |
||
121 | #>> FreeType2 |
||
122 | |||
24350 | craig | 123 | set(cairo_DIR ${CMAKE_MODULE_PATH}) |
124 | find_package(cairo REQUIRED) |
||
125 | if(cairo_FOUND) |
||
24473 | jghali | 126 | set(HAVE_CAIRO ON) |
24350 | craig | 127 | message("cairo Library found OK") |
23128 | craig | 128 | else() |
24350 | craig | 129 | message(FATAL_ERROR "No cairo library found") |
23128 | craig | 130 | endif() |
131 | #>>Render Library |
||
132 | |||
133 | #<<CUPS |
||
134 | if(NOT WIN32 AND NOT HAIKU) |
||
135 | find_package(Cups REQUIRED) |
||
136 | if(CUPS_FOUND) |
||
137 | set(HAVE_CUPS ON) |
||
138 | message("CUPS Library Found OK") |
||
139 | endif() |
||
140 | else() |
||
141 | # Windows doesn't use CUPS |
||
142 | set(CUPS_INCLUDE_DIR) |
||
143 | endif() |
||
144 | #>>CUPS |
||
145 | |||
146 | #<<LibXML2 |
||
147 | find_package(LibXml2 REQUIRED) |
||
148 | if(LIBXML2_FOUND) |
||
149 | set(HAVE_XML ON) |
||
150 | message("LIBXML2 Library Found OK") |
||
151 | endif() |
||
152 | #>>LibXML2 |
||
153 | |||
154 | #<<LittleCMS |
||
155 | set(LCMS_DIR ${CMAKE_MODULE_PATH}) |
||
156 | find_package(LCMS2 REQUIRED) |
||
157 | if(LCMS2_FOUND) |
||
158 | set(HAVE_LCMS2 ON) |
||
159 | message("LittleCMS-2 Library Found OK") |
||
160 | else() |
||
161 | message(FATAL_ERROR "Could not find the LittleCMS 2 Library") |
||
162 | endif() |
||
163 | #>>LittleCMS |
||
164 | |||
165 | #<<FontConfig |
||
166 | if(NOT WIN32) |
||
23419 | craig | 167 | find_package(Fontconfig REQUIRED) |
168 | if(Fontconfig_FOUND) |
||
23128 | craig | 169 | message("FontConfig Found OK") |
170 | set(HAVE_FONTCONFIG ON) |
||
171 | endif() |
||
172 | endif() |
||
173 | #>>FontConfig |
||
174 | |||
23476 | jghali | 175 | #<<HUNSPELL for Spelling support |
25061 | craig | 176 | find_package(hunspell 1.6 QUIET REQUIRED) |
24858 | craig | 177 | if (hunspell_FOUND) |
24986 | craig | 178 | message("hunspell Found OK ${hunspell_VERSION}") |
24858 | craig | 179 | set(HAVE_HUNSPELL ON) |
24986 | craig | 180 | set(HUNSPELL_VERSION ${hunspell_VERSION}) |
24858 | craig | 181 | else() |
182 | message("hunspell or its developer libraries NOT found - Disabling support for spell checking") |
||
23128 | craig | 183 | endif() |
23476 | jghali | 184 | #>>HUNSPELL for Spelling support |
23128 | craig | 185 | |
186 | #<<PoDoFo for AI PDF import |
||
187 | option(WITH_PODOFO "Enable support for PDF embedded in AI" ON) |
||
188 | if (WITH_PODOFO) |
||
189 | find_package(LIBPODOFO) |
||
190 | if (LIBPODOFO_FOUND) |
||
191 | message("PoDoFo found OK") |
||
192 | set(HAVE_PODOFO ON) |
||
193 | else() |
||
194 | message("PoDoFo NOT found - Disabling support for PDF embedded in AI") |
||
195 | endif() |
||
196 | endif() |
||
197 | #>>PoDoFo for AI PDF import |
||
198 | |||
199 | #<<Boost for 2Geom Tools |
||
200 | option(WITH_BOOST "Enable support for Boost based enhancements" ON) |
||
201 | if (WITH_BOOST) |
||
202 | find_package(Boost) |
||
203 | if (Boost_FOUND) |
||
204 | message("Boost Library Found OK") |
||
205 | set(HAVE_BOOST ON) |
||
206 | else() |
||
207 | message("Boost: NOT FOUND, not building 2geomtools") |
||
208 | endif() |
||
209 | endif() |
||
210 | #>>Boost for 2Geom Tools |
||
211 | |||
212 | #<< GraphicsMagick for image import |
||
213 | if (WANT_GRAPHICSMAGICK) |
||
214 | set(GMAGICK_DIR ${CMAKE_MODULE_PATH}) |
||
215 | pkg_check_modules(GMAGICK GraphicsMagick) |
||
216 | # find_package(GMAGICK) |
||
217 | if(GMAGICK_FOUND) |
||
218 | message(" GraphicsMagick Found OK") |
||
219 | else() |
||
220 | message(" GraphicsMagick NOT found! Building without additional image format support!") |
||
221 | endif() |
||
222 | else() |
||
223 | message("Building without GraphicsMagick (use -DWANT_GRAPHICSMAGICK=1 to enable)") |
||
224 | endif() |
||
225 | #>> GraphicsMagick for image import |
||
226 | |||
227 | #<<Poppler for PDF import |
||
24339 | craig | 228 | find_package(poppler REQUIRED) |
229 | if (poppler_FOUND) |
||
23128 | craig | 230 | set(HAVE_POPPLER ON) |
231 | message(STATUS "Found poppler") |
||
24339 | craig | 232 | message(STATUS "Found poppler libs: ${poppler_LIBRARY}") |
233 | message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}") |
||
24799 | craig | 234 | if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0) |
235 | message(STATUS "Poppler Version:" ${poppler_VERSION}) |
||
236 | message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0") |
||
237 | if (CMAKE_CXX_STANDARD LESS 17) |
||
238 | message(FATAL_ERROR "Please set -DWANT_CPP17=ON on your CMake command line") |
||
239 | endif() |
||
240 | endif() |
||
23128 | craig | 241 | else() |
242 | message(FATAL_ERROR "Could not find poppler library") |
||
243 | endif() |
||
244 | #>>Poppler for PDF import |
||
245 | |||
246 | # librevenge for MsPub import |
||
247 | pkg_check_modules(LIBREVENGE librevenge-0.0) |
||
248 | if (LIBREVENGE_FOUND) |
||
249 | pkg_check_modules(LIBREVENGE_STREAM librevenge-stream-0.0) |
||
250 | if (LIBREVENGE_STREAM_FOUND) |
||
251 | pkg_check_modules(LIBREVENGE_GENERATORS librevenge-generators-0.0) |
||
252 | if (LIBREVENGE_GENERATORS_FOUND) |
||
253 | set(HAVE_REVENGE ON) |
||
254 | endif() |
||
255 | endif() |
||
256 | endif() |
||
257 | |||
258 | # CTL support |
||
259 | pkg_check_modules(HARFBUZZ REQUIRED harfbuzz>=0.9.42 harfbuzz-icu) |
||
24514 | jghali | 260 | if (HARFBUZZ_FOUND) |
261 | message("Harfbuzz library Found OK") |
||
262 | endif() |
||
23128 | craig | 263 | pkg_check_modules(ICU REQUIRED icu-uc) |
24469 | jghali | 264 | |
265 | # OpenType subsetting support |
||
24535 | jghali | 266 | pkg_check_modules(HARFBUZZ_SUBSET harfbuzz-subset>=2.4.0) |
24469 | jghali | 267 | if (HARFBUZZ_SUBSET_FOUND) |
24472 | jghali | 268 | message("Harfbuzz subset library Found OK") |
24469 | jghali | 269 | set (HAVE_HARFBUZZ_SUBSET ON) |
24494 | craig | 270 | endif() |