Subversion Repositories Scribus

Rev

Rev 24350 | Rev 24469 | 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
24314 craig 5
#Qt less than 6
23128 craig 6
set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
7
set(CMAKE_INCLUDE_CURRENT_DIR ON)
24314 craig 8
 
9
if (NOT WANT_QT6)
10
	message(STATUS "Qt5 Requested")
11
	set(QT_MIN_VERSION "5.14.0")
12
	find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED)
13
	if(NOT Qt5Core_FOUND)
14
		message(FATAL_ERROR "ERROR: No QT 5 found")
15
	endif()
16
	find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED)
17
	if(NOT Qt5Widgets_FOUND)
18
		message(FATAL_ERROR "ERROR: No QT Widgets found")
19
	endif()
20
	find_package(Qt5Gui ${QT_MIN_VERSION} REQUIRED)
21
	if(NOT Qt5Gui_FOUND)
22
		message(FATAL_ERROR "ERROR: No Qt5Gui found")
23
	endif()
24
	find_package(Qt5Xml ${QT_MIN_VERSION} REQUIRED)
25
	if(NOT Qt5Xml_FOUND)
26
		message(FATAL_ERROR "ERROR: No QT 5 XML found")
27
	endif()
28
	find_package(Qt5Network ${QT_MIN_VERSION} REQUIRED)
29
	if(NOT Qt5Network_FOUND)
30
		message(FATAL_ERROR "ERROR: No Qt5Network found")
31
	endif()
32
	find_package(Qt5OpenGL ${QT_MIN_VERSION} REQUIRED)
33
	if(NOT Qt5OpenGL_FOUND)
34
		message(FATAL_ERROR "ERROR: No Qt5OpenGL found")
35
	endif()
36
	find_package(Qt5LinguistTools ${QT_MIN_VERSION} REQUIRED)
37
	if(NOT Qt5LinguistTools_FOUND)
38
		message(FATAL_ERROR "ERROR: No Qt5LinguistTools found")
39
	endif()
40
	#find_package(Qt5Quick ${QT_MIN_VERSION} REQUIRED)
41
	#if(Qt5Quick_FOUND)
42
	#    message(STATUS "----- USE Qt5Quick -----")
43
	#else()
44
	#    message(FATAL_ERROR "ERROR: No Qt5Quick found")
45
	#endif()
46
	find_package(Qt5PrintSupport ${QT_MIN_VERSION} REQUIRED)
47
	if(NOT Qt5PrintSupport_FOUND)
48
		message(FATAL_ERROR "ERROR: No Qt5PrintSupport found")
49
	endif()
50
	include_directories(${Qt5Core_INCLUDE_DIRS})
51
	add_definitions(${Qt5Core_DEFINITIONS})
52
	include_directories(${Qt5Widgets_INCLUDE_DIRS})
53
	add_definitions(${Qt5Widgets_DEFINITIONS})
54
	include_directories(${Qt5Gui_INCLUDE_DIRS})
55
	add_definitions(${Qt5Gui_DEFINITIONS})
56
	include_directories(${Qt5Xml_INCLUDE_DIRS})
57
	add_definitions(${Qt5Xml_DEFINITIONS})
58
	include_directories(${Qt5Network_INCLUDE_DIRS})
59
	add_definitions(${Qt5Network_DEFINITIONS})
60
	include_directories(${Qt5OpenGL_INCLUDE_DIRS})
61
	add_definitions(${Qt5OpenGL_DEFINITIONS})
62
	include_directories(${Qt5PrintSupport_INCLUDE_DIRS})
63
	add_definitions(${Qt5PrintSupport_DEFINITIONS})
64
 
65
	message(STATUS "Qt Version Found: ${Qt5Widgets_VERSION}")
23128 craig 66
else()
24314 craig 67
#WANT QT6
68
    message(STATUS "Qt6 Requested")
69
	find_package(Qt6 COMPONENTS Widgets REQUIRED)
70
	message(STATUS "Qt Version Found: ${Qt6Widgets_VERSION}")
23128 craig 71
endif()
72
 
73
 
74
 
75
 
76
#<< ZLIB, PNG
77
if (WIN32)
78
	# On win32 we can use Qt's zlib and libpng, so we use some
79
	# custom cmake includes. This permits us to honour the
80
	# USE_QT_ZLIB_PNGLIB flag if passed.
81
	set(PNG_DIR ${CMAKE_MODULE_PATH})
82
	set(ZLIB_DIR ${CMAKE_MODULE_PATH})
83
endif()
84
find_package(ZLIB REQUIRED)
85
if (ZLIB_FOUND)
86
	message("ZLIB Library Found OK")
87
	set(HAVE_LIBZ ON)
88
endif()
89
#find_package(PNG REQUIRED)
90
#if (PNG_FOUND)
91
#	message("PNG Library Found OK")
92
#endif()
93
#>> ZLIB, PNG
94
 
95
if (WANT_NOOSG)
96
	message("Building without 3D Extension")
97
else()
98
	find_package(OSG)
99
	if(OSG_FOUND)
100
		message("OSG found OK")
101
		set(HAVE_OSG ON)
102
		find_package(OpenGL)
103
		include(CheckFunctionExists)
104
		CHECK_FUNCTION_EXISTS(memrchr HAVE_MEMRCHR)
105
	else()
106
		message("No OSG found, building without 3D Extension")
107
	endif()
108
endif()
109
 
23489 jghali 110
#<< JPEG, PNG, TIFF
23128 craig 111
find_package(JPEG REQUIRED)
112
if (JPEG_FOUND)
113
	message("JPEG Library Found OK")
114
endif()
23489 jghali 115
 
116
find_package(PNG 1.6 REQUIRED)
117
if (PNG_FOUND)
118
	message("PNG Library Found OK")
119
endif()
120
 
23128 craig 121
find_package(TIFF REQUIRED)
122
if (TIFF_FOUND)
123
	message("TIFF Library Found OK")
124
	set(HAVE_TIFF ON)
125
else()
126
	message(FATAL_ERROR "Could not find the TIFF Library")
127
endif()
128
#<< JPEG, TIFF
129
 
130
#<< PYTHON
23352 craig 131
if (NOT WANT_PYTHON_2X)
132
	message("Python 3.x Selected")
133
	find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
134
	if (Python3_Development_FOUND)
135
		message("Python 3.x Library Found OK (Version ${Python3_VERSION})")
136
		message("Interpreter: ${Python3_EXECUTABLE}")
137
		message("Include directories: ${Python3_INCLUDE_DIRS}")
138
		message("Library directories: ${Python3_LIBRARY_DIRS}")
139
		message("Runtime library directories: ${Python3_RUNTIME_LIBRARY_DIRS}")
140
		set(HAVE_PYTHON ON)
141
		set(COMPILE_PYTHON ON)
142
	endif()
143
else()
144
	message("Python 2.x Requested")
145
	find_package (Python2 REQUIRED COMPONENTS Interpreter Development)
146
	if (Python2_Development_FOUND)
147
		message("Python 2.x Library Found OK (Version ${Python2_VERSION})")
148
		message("Interpreter: ${Python2_EXECUTABLE}")
149
		message("Include directories: ${Python2_INCLUDE_DIRS}")
150
		message("Library directories: ${Python2_LIBRARY_DIRS}")
151
		message("Runtime library directories: ${Python2_RUNTIME_LIBRARY_DIRS}")
152
		set(HAVE_PYTHON ON)
153
		set(COMPILE_PYTHON ON)
154
	endif()
23128 craig 155
endif()
156
#>> PYTHON
157
 
158
#<< FreeType2
159
find_package(Freetype REQUIRED)
160
if (FREETYPE_FOUND)
161
	message(STATUS "FreeType2 Library Found OK")
162
else()
163
	message(FATAL_ERROR "No Freetype Found")
164
endif()
165
#>> FreeType2
166
 
24350 craig 167
set(cairo_DIR ${CMAKE_MODULE_PATH})
168
find_package(cairo REQUIRED)
169
if(cairo_FOUND)
170
	message("cairo Library found OK")
23128 craig 171
else()
24350 craig 172
	message(FATAL_ERROR "No cairo library found")
23128 craig 173
endif()
174
#>>Render Library
175
 
176
#<<CUPS
177
if(NOT WIN32 AND NOT HAIKU)
178
	find_package(Cups REQUIRED)
179
	if(CUPS_FOUND)
180
		set(HAVE_CUPS ON)
181
		message("CUPS Library Found OK")
182
	endif()
183
else()
184
	# Windows doesn't use CUPS
185
	set(CUPS_INCLUDE_DIR)
186
endif()
187
#>>CUPS
188
 
189
#<<LibXML2
190
find_package(LibXml2 REQUIRED)
191
if(LIBXML2_FOUND)
192
	set(HAVE_XML ON)
193
	message("LIBXML2 Library Found OK")
194
endif()
195
#>>LibXML2
196
 
197
#<<LittleCMS
198
set(LCMS_DIR ${CMAKE_MODULE_PATH})
199
find_package(LCMS2 REQUIRED)
200
if(LCMS2_FOUND)
201
	set(HAVE_LCMS2 ON)
202
	set(HAVE_CMS ON)
203
	set(CMS_INC "\"lcms2.h\"")
204
	message("LittleCMS-2 Library Found OK")
205
else()
206
	message(FATAL_ERROR "Could not find the LittleCMS 2 Library")
207
endif()
208
#>>LittleCMS
209
 
210
#<<FontConfig
211
if(NOT WIN32)
23419 craig 212
	find_package(Fontconfig REQUIRED)
213
	if(Fontconfig_FOUND)
23128 craig 214
		message("FontConfig Found OK")
215
		set(HAVE_FONTCONFIG ON)
216
	endif()
217
endif()
218
#>>FontConfig
219
 
23476 jghali 220
#<<HUNSPELL for Spelling support
23128 craig 221
option(WANT_HUNSPELL "Enable support for spell checking with hunspell" ON)
222
if (WANT_HUNSPELL)
24351 craig 223
	find_package(hunspell)
224
	if (hunspell_FOUND)
225
		message("hunspell Found OK")
23128 craig 226
		set(HAVE_HUNSPELL ON)
227
	else()
24351 craig 228
		message("hunspell or its developer libraries NOT found - Disabling support for spell checking")
23128 craig 229
	endif()
230
endif()
23476 jghali 231
#>>HUNSPELL for Spelling support
23128 craig 232
 
233
#<<PoDoFo for AI PDF import
234
option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
235
if (WITH_PODOFO)
236
	find_package(LIBPODOFO)
237
	if (LIBPODOFO_FOUND)
238
		message("PoDoFo found OK")
239
		set(HAVE_PODOFO ON)
240
	else()
241
		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
242
	endif()
243
endif()
244
#>>PoDoFo for AI PDF import
245
 
246
#<<Boost for 2Geom Tools
247
option(WITH_BOOST "Enable support for Boost based enhancements" ON)
248
if (WITH_BOOST)
249
	find_package(Boost)
250
	if (Boost_FOUND)
251
		message("Boost Library Found OK")
252
		set(HAVE_BOOST ON)
253
	else()
254
		message("Boost: NOT FOUND, not building 2geomtools")
255
	endif()
256
endif()
257
#>>Boost for 2Geom Tools
258
 
259
#<< GraphicsMagick for image import
260
if (WANT_GRAPHICSMAGICK)
261
	set(GMAGICK_DIR ${CMAKE_MODULE_PATH})
262
	pkg_check_modules(GMAGICK GraphicsMagick)
263
	# find_package(GMAGICK)
264
	if(GMAGICK_FOUND)
265
		message(" GraphicsMagick Found OK")
266
	else()
267
		message(" GraphicsMagick NOT found! Building without additional image format support!")
268
	endif()
269
else()
270
	message("Building without  GraphicsMagick (use -DWANT_GRAPHICSMAGICK=1 to enable)")
271
endif()
272
#>> GraphicsMagick for image import
273
 
274
#<<Poppler for PDF import
24339 craig 275
find_package(poppler REQUIRED)
276
if (poppler_FOUND)
23128 craig 277
	set(HAVE_POPPLER ON)
278
	message(STATUS "Found poppler")
24339 craig 279
	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
280
	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
23128 craig 281
else()
282
	message(FATAL_ERROR "Could not find poppler library")
283
endif()
284
#>>Poppler for PDF import
285
 
286
# librevenge for MsPub import
287
pkg_check_modules(LIBREVENGE librevenge-0.0)
288
if (LIBREVENGE_FOUND)
289
	pkg_check_modules(LIBREVENGE_STREAM librevenge-stream-0.0)
290
	if (LIBREVENGE_STREAM_FOUND)
291
		pkg_check_modules(LIBREVENGE_GENERATORS librevenge-generators-0.0)
292
		if (LIBREVENGE_GENERATORS_FOUND)
293
			set(HAVE_REVENGE ON)
294
		endif()
295
	endif()
296
endif()
297
 
298
# CTL support
299
pkg_check_modules(HARFBUZZ REQUIRED harfbuzz>=0.9.42 harfbuzz-icu)
300
pkg_check_modules(ICU REQUIRED icu-uc)