-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathCMakeLists_Dependencies.cmake
319 lines (295 loc) · 8.86 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
314
315
316
317
318
319
##############################################################################################################
########## Find Dependencies ##########
#<< Qt
set(QT_MIN_VERSION "5.10.0")
set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED)
if(Qt5Core_FOUND)
message(STATUS "----- USE QT 5-----")
else()
message(FATAL_ERROR "ERROR: No QT 5 found")
endif()
find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED)
if(Qt5Widgets_FOUND)
message(STATUS "----- USE QT Widgets-----")
else()
message(FATAL_ERROR "ERROR: No QT Widgets found")
endif()
find_package(Qt5Gui ${QT_MIN_VERSION} REQUIRED)
if(Qt5Gui_FOUND)
message(STATUS "----- USE Qt5Gui -----")
else()
message(FATAL_ERROR "ERROR: Qt5Gui found")
endif()
find_package(Qt5Xml ${QT_MIN_VERSION} REQUIRED)
if(Qt5Xml_FOUND)
message(STATUS "----- USE QT 5 XML -----")
else()
message(FATAL_ERROR "ERROR: No QT 5 XML found")
endif()
find_package(Qt5Network ${QT_MIN_VERSION} REQUIRED)
if(Qt5Network_FOUND)
message(STATUS "----- USE Qt5Network -----")
else()
message(FATAL_ERROR "ERROR: No Qt5Network found")
endif()
find_package(Qt5OpenGL ${QT_MIN_VERSION} REQUIRED)
if(Qt5OpenGL_FOUND)
message(STATUS "----- USE Qt5OpenGL -----")
else()
message(FATAL_ERROR "ERROR: No Qt5OpenGL found")
endif()
find_package(Qt5LinguistTools ${QT_MIN_VERSION} REQUIRED)
if(Qt5LinguistTools_FOUND)
message(STATUS "----- USE Qt5LinguistTools -----")
else()
message(FATAL_ERROR "ERROR: No Qt5LinguistTools found")
endif()
#find_package(Qt5Quick ${QT_MIN_VERSION} REQUIRED)
#if(Qt5Quick_FOUND)
# message(STATUS "----- USE Qt5Quick -----")
#else()
# message(FATAL_ERROR "ERROR: No Qt5Quick found")
#endif()
find_package(Qt5PrintSupport ${QT_MIN_VERSION} REQUIRED)
if(Qt5PrintSupport_FOUND)
message(STATUS "----- USE Qt5PrintSupport -----")
else()
message(FATAL_ERROR "ERROR: No Qt5PrintSupport found")
endif()
include_directories(${Qt5Core_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITIONS})
include_directories(${Qt5Gui_INCLUDE_DIRS})
add_definitions(${Qt5Gui_DEFINITIONS})
include_directories(${Qt5Xml_INCLUDE_DIRS})
add_definitions(${Qt5Xml_DEFINITIONS})
include_directories(${Qt5Network_INCLUDE_DIRS})
add_definitions(${Qt5Network_DEFINITIONS})
include_directories(${Qt5OpenGL_INCLUDE_DIRS})
add_definitions(${Qt5OpenGL_DEFINITIONS})
#include_directories(${Qt5Quick_INCLUDE_DIRS})
#add_definitions(${Qt5Quick_DEFINITIONS})
include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
add_definitions(${Qt5PrintSupport_DEFINITIONS})
message(STATUS "Qt VERSION: ${Qt5Widgets_VERSION}")
#if (NOT WANT_CPP11 AND Qt5Widgets_VERSION_MAJOR EQUAL 5 AND Qt5Widgets_VERSION_MINOR GREATER 6)
# message(STATUS "Your Qt version is 5.7.0 or superior, enabling C++11 compiler features")
# set(WANT_CPP11 ON)
#endif()
#>> Qt
#<< ZLIB, 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()
find_package(ZLIB REQUIRED)
if (ZLIB_FOUND)
message("ZLIB Library Found OK")
set(HAVE_LIBZ ON)
endif()
#find_package(PNG REQUIRED)
#if (PNG_FOUND)
# message("PNG Library Found OK")
#endif()
#>> ZLIB, PNG
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, TIFF
find_package(JPEG REQUIRED)
if (JPEG_FOUND)
message("JPEG 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
if (NOT WANT_PYTHON_2X)
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)
set(COMPILE_PYTHON ON)
endif()
else()
message("Python 2.x Requested")
find_package (Python2 REQUIRED COMPONENTS Interpreter Development)
if (Python2_Development_FOUND)
message("Python 2.x Library Found OK (Version ${Python2_VERSION})")
message("Interpreter: ${Python2_EXECUTABLE}")
message("Include directories: ${Python2_INCLUDE_DIRS}")
message("Library directories: ${Python2_LIBRARY_DIRS}")
message("Runtime library directories: ${Python2_RUNTIME_LIBRARY_DIRS}")
set(HAVE_PYTHON ON)
set(COMPILE_PYTHON ON)
endif()
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
#<<Render Library
if (WANT_PRIVATE_CAIRO)
message("We no longer support the private cairo library as the latest public release is more up to date, setting WANT_SYSTEM_CAIRO=1")
endif()
if (RENDER_LIB)
if (RENDER_LIB STREQUAL "QTARTHUR")
message("Qt4's Arthur as renderer is not supported anymore, performing renderer detection again")
endif()
endif()
set(CAIRO_DIR ${CMAKE_MODULE_PATH})
find_package(CAIRO REQUIRED)
if(CAIRO_FOUND)
message("CAIRO Library Found OK")
set(RENDER_LIB "CAIRO_SYSTEM" CACHE STRING "Set render library to cairo")
else()
message(FATAL_ERROR "No Cairo 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 REQUIRED)
if(LIBXML2_FOUND)
set(HAVE_XML ON)
message("LIBXML2 Library Found OK")
endif()
#>>LibXML2
#<<LittleCMS
set(LCMS_DIR ${CMAKE_MODULE_PATH})
find_package(LCMS2 REQUIRED)
if(LCMS2_FOUND)
set(HAVE_LCMS2 ON)
set(HAVE_CMS ON)
set(CMS_INC "\"lcms2.h\"")
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 Speelling support
option(WANT_HUNSPELL "Enable support for spell checking with hunspell" ON)
if (WANT_HUNSPELL)
find_package(HUNSPELL)
if (HUNSPELL_FOUND)
message("Hunspell Found OK")
set(HAVE_HUNSPELL ON)
else()
message("Hunspell or its developer libraries NOT found - Disabling support for spell checking")
endif()
endif()
#>>HUNSPELL for Speelling support
#<<PoDoFo for AI PDF import
option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
if (WITH_PODOFO)
find_package(LIBPODOFO)
if (LIBPODOFO_FOUND)
message("PoDoFo found OK")
set(HAVE_PODOFO ON)
else()
message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
endif()
endif()
#>>PoDoFo for AI PDF import
#<<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
#<<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}")
else()
message(FATAL_ERROR "Could not find poppler library")
endif()
#>>Poppler for PDF 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>=0.9.42 harfbuzz-icu)
pkg_check_modules(ICU REQUIRED icu-uc)