Newer
Older
#---Check for installed packages-----------------------------------------------------
#---Check if (N)Curses is installed. If neither is installed switch off editline-----
#if(editline)
# message(STATUS "Looking for NCurses")
# set(CURSES_NEED_NCURSES TRUE)
# find_package(Curses)
# if(NOT CURSES_FOUND)
# message(STATUS "Looking for Curses")
# set(CURSES_NEED_NCURSES FALSE)
# find_package(Curses)
# endif()
# if(CURSES_FOUND)
# if(CURSES_HAVE_CURSES_H)
# set(CURSES_HEADER_FILE ${CURSES_HAVE_CURSES_H})
# endif()
# if(CURSES_HAVE_NCURSES_H)
# set(CURSES_HEADER_FILE ${CURSES_HAVE_NCURSES_H})
# endif()
# else()
# set(editline OFF)
# endif()
#endif()
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
#---Check for Zlib ------------------------------------------------------------------
if(NOT builtin_zlib)
message(STATUS "Looking for ZLib")
find_Package(ZLIB)
if(NOT ZLIB_FOUND)
message(STATUS "Zlib not found. Switching on builtin_zlib option")
set(builtin_zlib ON)
endif()
endif()
if(builtin_zlib)
set(ZLIB_LIBRARY "")
endif()
#---Check for Freetype---------------------------------------------------------------
if(NOT builtin_freetype)
message(STATUS "Looking for Freetype")
find_package(Freetype)
if(FREETYPE_FOUND)
set(FREETYPE_INCLUDE_DIR ${FREETYPE_INCLUDE_DIR_freetype2})
else()
message(STATUS "FreeType not found. Switching on builtin_freetype option")
set(builtin_freetype ON)
endif()
endif()
if(builtin_freetype)
set(FREETYPE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/graf2d/freetype/freetype-2.3.12/include)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
if(WIN32)
set(FREETYPE_LIBRARIES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/freetype.lib")
else()
set(FREETYPE_LIBRARIES "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -lfreetype")
endif()
endif()
#---Check for PCRE-------------------------------------------------------------------
if(NOT builtin_pcre)
message(STATUS "Looking for PCRE")
find_package(PCRE)
if(PCRE_FOUND)
else()
message(STATUS "PCRE not found. Switching on builtin_pcre option")
set(builtin_pcre ON)
endif()
endif()
if(builtin_pcre)
set(PCRE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/core/pcre/pcre-7.8)
if(WIN32)
set(PCRE_LIBRARIES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpcre.lib)
else()
set(PCRE_LIBRARIES "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -lpcre")
endif()
endif()
#---Check for X11 which is mandatory lib on Unix--------------------------------------
if(x11)
message(STATUS "Looking for X11")
find_package(X11 REQUIRED)
if(X11_FOUND)
list(REMOVE_DUPLICATES X11_INCLUDE_DIR)
message(STATUS "X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}")
message(STATUS "X11_LIBRARIES: ${X11_LIBRARIES}")
else()
message(FATAL_ERROR "libX11 and X11 headers must be installed.")
endif()
if(X11_Xpm_FOUND)
message(STATUS "X11_Xpm_INCLUDE_PATH: ${X11_Xpm_INCLUDE_PATH}")
message(STATUS "X11_Xpm_LIB: ${X11_Xpm_LIB}")
else()
message(FATAL_ERROR "libXpm and Xpm headers must be installed.")
endif()
if(X11_Xft_FOUND)
message(STATUS "X11_Xft_INCLUDE_PATH: ${X11_Xft_INCLUDE_PATH}")
message(STATUS "X11_Xft_LIB: ${X11_Xft_LIB}")
else()
message(FATAL_ERROR "libXft and Xft headers must be installed.")
endif()
if(X11_Xext_FOUND)
message(STATUS "X11_Xext_INCLUDE_PATH: ${X11_Xext_INCLUDE_PATH}")
message(STATUS "X11_Xext_LIB: ${X11_Xext_LIB}")
else()
message(FATAL_ERROR "libXext and Xext headers must be installed.")
endif()
endif()
#---Check for all kind of graphics includes needed by libAfterImage--------------------
if(asimage)
set(ASEXTRA_LIBRARIES)
find_Package(GIF)
if(GIF_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${GIF_LIBRARIES})
endif()
find_Package(TIFF)
if(TIFF_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${TIFF_LIBRARIES})
endif()
find_Package(PNG)
if(PNG_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${PNG_LIBRARIES})
endif()
find_Package(JPEG)
if(JPEG_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${JPEG_LIBRARIES})
endif()
endif()
#---Check for GSL library---------------------------------------------------------------
if(mathmore)
message(STATUS "Looking for GSL")
find_package(GSL)
if(NOT GSL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "GSL package not found and mathmore component required")
else()
set(mathmore OFF)
message(STATUS "GSL not found. Switching off mathmore option")
endif()
endif()
endif()
#---Check for Python installation-------------------------------------------------------
if(python)
message(STATUS "Looking for Python")
find_package(PythonLibs)
if(NOT PYTHONLIBS_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "PythonLibs package not found and python component required")
else()
set(python OFF)
message(STATUS "Python not found. Switching off python option")
endif()
else()
find_package(PythonInterp)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys;sys.stdout.write(sys.version[:3])"
OUTPUT_VARIABLE PYTHON_VERSION)
endif()
endif()
#---Check for Ruby installation-------------------------------------------------------
if(ruby)
message(STATUS "Looking for Ruby")
find_package(Ruby)
if(NOT RUBY_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Ruby package not found and ruby component required")
else()
set(ruby OFF)
message(STATUS "Ruby not found. Switching off ruby option")
endif()
endif()
endif()
#---Check for GCCXML installation-------------------------------------------------------
if(cintex OR reflex)
message(STATUS "Looking for GCCXML")
find_package(GCCXML)
if(GCCXML_FOUND)
set(gccxml ${GCCXML_EXECUTABLE})
else()
if(fail-on-missing)
message(FATAL_ERROR "GCCXML not found and cintex or reflex option required")
endif()
endif()
endif()
#---Check for OpenGL installation-------------------------------------------------------
if(opengl)
message(STATUS "Looking for OpenGL")
find_package(OpenGL)
if(NOT OPENGL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "OpenGL package not found and opengl option required")
else()
set(opengl OFF)
message(STATUS "OpenGL not found. Switching off opengl option")
endif()
endif()
if(APPLE)
find_path(OPENGL_INCLUDE_DIR GL/gl.h DOC "Include for OpenGL on OSX")
endif()
endif()
#---Check for Graphviz installation-------------------------------------------------------
if(gviz)
message(STATUS "Looking for Graphviz")
find_package(Graphviz)
if(NOT GRAPHVIZ_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Graphviz package not found and gviz option required")
else()
set(gviz OFF)
message(STATUS "Graphviz not found. Switching off gviz option")
endif()
endif()
endif()
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
#---Check for Qt installation-------------------------------------------------------
if(qt)
message(STATUS "Looking for Qt4")
find_package(Qt4 COMPONENTS QtCore QtGui)
if(NOT QT4_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Qt4 package not found and qt component required")
else()
set(qt OFF)
message(STATUS "Qt4 not found. Switching off qt option")
endif()
endif()
endif()
#---Check for Bonjour installation-------------------------------------------------------
if(bonjour)
message(STATUS "Looking for Bonjour")
find_package(Bonjour)
if(NOT BONJOUR_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Bonjour/Avahi libraries not found and Bonjour component required")
else()
set(bonjour OFF)
message(STATUS "Bonjour not found. Switching off bonjour option")
endif()
endif()
endif()
#---Check for krb5 Support-----------------------------------------------------------
if(krb5)
message(STATUS "Looking for Kerberos 5")
find_package(Kerberos5)
if(NOT KRB5_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Kerberos 5 libraries not found and they are required")
else()
set(krb5 OFF)
message(STATUS "Kerberos 5 not found. Switching off krb5 option")
endif()
endif()
endif()
#---Check for XML Parser Support-----------------------------------------------------------
if(xml)
message(STATUS "Looking for LibXml2")
find_package(LibXml2)
if(NOT LIBXML2_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "LibXml2 libraries not found and they are required (xml option enabled)")
else()
set(xml OFF)
message(STATUS "LibXml2 not found. Switching off xml option")
endif()
endif()
endif()
#---Check for OpenSSL------------------------------------------------------------------
if(ssl)
message(STATUS "Looking for OpenSSL")
find_package(OpenSSL)
if(NOT OPENSSL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "OpenSSL libraries not found and they are required (ssl option enabled)")
else()
set(ssl OFF)
message(STATUS "OpenSSL not found. Switching off ssl option")
endif()
endif()
endif()
#---Check for Castor-------------------------------------------------------------------
message(STATUS "Looking for Castor")
find_package(Castor)
if(NOT CASTOR_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Castor libraries not found and they are required (castor option enabled)")
else()
set(castor OFF)
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
set(rfio OFF)
message(STATUS "Castor not found. Switching off castor/rfio option")
endif()
endif()
endif()
#---Check for MySQL-------------------------------------------------------------------
if(mysql)
message(STATUS "Looking for MySQL")
find_package(MySQL)
if(NOT MYSQL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "MySQL libraries not found and they are required (mysql option enabled)")
else()
set(mysql OFF)
message(STATUS "MySQL not found. Switching off mysql option")
endif()
endif()
endif()
#---Check for Oracle-------------------------------------------------------------------
if(oracle)
message(STATUS "Looking for Oracle")
find_package(Oracle)
if(NOT ORACLE_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Oracle libraries not found and they are required (orable option enabled)")
else()
set(oracle OFF)
message(STATUS "Oracle not found. Switching off oracle option")
endif()
endif()
endif()
#---Check for ODBC-------------------------------------------------------------------
if(odbc)
message(STATUS "Looking for ODBC")
find_package(ODBC)
if(NOT ODBC_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "ODBC libraries not found and they are required (odbc option enabled)")
else()
set(odbc OFF)
message(STATUS "ODBC not found. Switching off odbc option")
endif()
endif()
endif()
#---Check for Pythia6-------------------------------------------------------------------
if(pythia6)
message(STATUS "Looking for Pythia6")
find_package(Pythia6)
if(NOT PYTHIA6_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Pythia6 libraries not found and they are required (pythia6 option enabled)")
else()
set(pythia6 OFF)
message(STATUS "Pythia6 not found. Switching off pythia6 option")
endif()
endif()
endif()
#---Check for Pythia8-------------------------------------------------------------------
if(pythia8)
message(STATUS "Looking for Pythia8")
find_package(Pythia8)
if(NOT PYTHIA8_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Pythia8 libraries not found and they are required (pythia8 option enabled)")
else()
set(pythia8 OFF)
message(STATUS "Pythia8 not found. Switching off pythia8 option")
endif()
endif()
endif()
#---Check for FFTW3-------------------------------------------------------------------
if(fftw3)
message(STATUS "Looking for FFTW3")
find_package(FFTW)
if(NOT FFTW_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "FFTW3 libraries not found and they are required (fftw3 option enabled)")
else()
set(fftw3 OFF)
message(STATUS "FFTW3 not found. Switching off fftw3 option")