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