summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
blob: ac26c4d86c24a161e996ad9bc5c82c076bfd8cf7 (plain)
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
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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
#################################################
#
#  (C) 2011 Timothy Pearson
#  kb9vqf (AT) pearsoncomputing.net
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################


# required stuff
find_package( TQt )
find_package( TDE )

tde_setup_architecture_flags( )

include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

tde_setup_largefiles( )


##### check for gcc visibility support

if( WITH_GCC_VISIBILITY )
  tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )


check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )

check_include_file( stdint.h HAVE_STDINT_H )
check_include_file( systems.h HAVE_SYSTEMS_H )
check_include_file( linux/inotify.h HAVE_INOTIFY )

check_function_exists( statvfs HAVE_STATVFS )

if (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
    set(SQLITE_FOUND TRUE)
else (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
 include(UsePkgConfig)
 pkgconfig(sqlite3 _sqliteincdir _sqlitelibdir _sqlitelinkflags _sqlitecflags)

 find_path(SQLITE_INCLUDE_DIR sqlite3.h
   ${_sqliteincdir}
   /usr/include
   /usr/local/include
  )
 find_library(SQLITE_LIBRARIES NAMES sqlite3
   PATHS
   ${_sqlitelibdir}
   /usr/lib
   /usr/local/lib
 )

 if (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)
   set(SQLITE_FOUND TRUE)
 endif (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)

 if (SQLITE_FOUND)
   message(STATUS "Found sqlite3: ${SQLITE_LIBRARIES}")
 else (SQLITE_FOUND)
   message(STATUS "Could not find sqlite3")
   add_definitions(-DNO_SQLITE3)
 endif (SQLITE_FOUND)

 mark_as_advanced(SQLITE_LIBRARIES SQLITE_INCLUDE_DIR)

endif (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES)

set(SUBVERSIONFOUND)
set(SUBVERSION_ALL_LIBS)

include (CheckIncludeFiles)

#search libraries for UNIX
if (UNIX)

  macro(find_sub_lib targetvar libname)
    if (SUBVERSION_INSTALL_PATH)
        find_library(${targetvar} ${libname}
            PATHS
            ${SUBVERSION_INSTALL_PATH}/lib
            NO_DEFAULT_PATH
        )
    endif(SUBVERSION_INSTALL_PATH)
    find_library(${targetvar} ${libname}
        PATHS
        /usr/lib
        /usr/local/lib
        )
  endmacro(find_sub_lib)

  if (SUBVERSION_INSTALL_PATH)
    find_path(SUBVERSION_INCLUDE_DIR svn_client.h
        PATHS
        ${SUBVERSION_INSTALL_PATH}/include/subversion-1
        NO_DEFAULT_PATH
    )
  endif (SUBVERSION_INSTALL_PATH)
  find_path(SUBVERSION_INCLUDE_DIR svn_client.h
        /usr/include/subversion-1
        /usr/local/include/subversion-1)

  find_sub_lib(SUBVERSION_CLIENTLIB svn_client-1)
  find_sub_lib(SUBVERSION_REPOSITORYLIB svn_repos-1)
  find_sub_lib(SUBVERSION_WCLIB svn_wc-1)
  find_sub_lib(SUBVERSION_FSLIB svn_fs-1)
  find_sub_lib(SUBVERSION_SUBRLIB svn_subr-1)
  find_sub_lib(SUBVERSION_RALIB svn_ra-1)
  find_sub_lib(SUBVERSION_DIFFLIB svn_diff-1)

  find_program(APR_CONFIG NAMES apr-config apr-1-config
    PATHS
    /usr/local/apr/bin
  )

  find_program(APU_CONFIG NAMES apu-config apu-1-config
    PATHS
    /usr/local/apr/bin
  )

  if(NOT APR_CONFIG)
    message(SEND_ERROR "Error: no apr-config found")
  endif(NOT APR_CONFIG)

  if(NOT APU_CONFIG)
    message(SEND_ERROR "Error: no apu-config found")
  endif(NOT APU_CONFIG)

  exec_program(${APR_CONFIG} ARGS "--includedir" OUTPUT_VARIABLE APR_INCLUDE_DIR_INT)

  pkg_search_module( APR apr-1 )
  if( NOT APR_FOUND )
    tde_message_fatal( "apr-1 is required, but was not found on your system" )
  endif( )

  exec_program(${APU_CONFIG} ARGS "--includedir" OUTPUT_VARIABLE APU_INCLUDE_DIR_INT)
  set(APR_INCLUDE_DIR "${APR_INCLUDE_DIR_INT}" CACHE INTERNAL "")
  set(APU_INCLUDE_DIR "${APU_INCLUDE_DIR_INT}" CACHE INTERNAL "")

  exec_program(${APR_CONFIG} ARGS "--cppflags" OUTPUT_VARIABLE APR_CPP_FLAGS_INT)
  exec_program(${APU_CONFIG} ARGS "--includes" OUTPUT_VARIABLE APU_CPP_FLAGS_INT)
  set(APR_CPP_FLAGS "${APR_CPP_FLAGS_INT}" CACHE INTERNAL "")
  set(APU_CPP_FLAGS "${APU_CPP_FLAGS_INT}" CACHE INTERNAL "")

  exec_program(${APR_CONFIG} ARGS "--ldflags --libs --link-ld" OUTPUT_VARIABLE APR_EXTRA_LIBFLAGS_INT)
  exec_program(${APU_CONFIG} ARGS "--ldflags --libs --link-ld" OUTPUT_VARIABLE APU_EXTRA_LIBFLAGS_INT)
  set(APR_EXTRA_LIBFLAGS "${APR_EXTRA_LIBFLAGS_INT}" CACHE INTERNAL "")
  set(APU_EXTRA_LIBFLAGS "${APU_EXTRA_LIBFLAGS_INT}" CACHE INTERNAL "")

  check_include_files(execinfo.h HAS_BACKTRACE_H)

endif (UNIX)

#search libaries for Windows
if (WIN32)

  # search for pathes
  find_path (SUBVERSION_BIN_DIR svn.exe
    "$ENV{ProgramFiles}/Subversion/bin"
  )

  find_path (SUBVERSION_INCLUDE_DIR svn_client.h
    "$ENV{ProgramFiles}/Subversion/include"
  )

  find_path(APR_INCLUDE_DIR apr.h
    "$ENV{ProgramFiles}/Subversion/include/apr"
  )

  find_path(APU_INCLUDE_DIR apu.h
    "$ENV{ProgramFiles}/Subversion/include/apr-util"
  )

  # search for libraries
  find_library(APR_LIB libapr
    "$ENV{ProgramFiles}/Subversion/lib/apr"
  )

  find_library(APRICONV_LIB libapriconv
    "$ENV{ProgramFiles}/Subversion/lib/apr-iconv"
  )

  find_library(APU_LIB libaprutil
    "$ENV{ProgramFiles}/Subversion/lib/apr-util"
  )

  find_library(APU_XMLLIB xml
    "$ENV{ProgramFiles}/Subversion/lib/apr-util"
  )

  find_library(NEON_LIB libneon
    "$ENV{ProgramFiles}/Subversion/lib/neon"
  )

  find_library(NEON_ZLIBSTATLIB zlibstat
    "$ENV{ProgramFiles}/Subversion/lib/neon"
  )

  find_library(INTL3LIB intl3_svn
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(DB44_LIB libdb44
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_CLIENTLIB libsvn_client-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_DELTALIB libsvn_delta-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_DIFFLIB libsvn_diff-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_FSBASELIB libsvn_fs_base-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_FSFSLIB libsvn_fs_fs-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_FSUTILLIB libsvn_fs_util-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_FSLIB libsvn_fs-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_RALOCALLIB libsvn_ra_local-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_RANEONLIB libsvn_ra_neon-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_RASVNLIB libsvn_ra_svn-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_RALIB libsvn_ra-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_REPOSITORYLIB libsvn_repos-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_SUBRLIB libsvn_subr-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  find_library(SUBVERSION_WCLIB libsvn_wc-1
    "$ENV{ProgramFiles}/Subversion/lib"
  )

  set(APR_EXTRA_LIBFLAGS )
  set(APU_EXTRA_LIBFLAGS )


  # check found libraries
  if (NOT APR_LIB)
    message(SEND_ERROR "No apr lib found!")
  else (NOT APR_LIB)
    message(STATUS "Found apr lib: ${APR_LIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${APR_LIB})
  endif(NOT APR_LIB)

  if (NOT APRICONV_LIB)
    message(SEND_ERROR "No apriconv lib found!")
  else (NOT APRICONV_LIB)
    message(STATUS "Found apriconv lib: ${APRICONV_LIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${APRICONV_LIB})
  endif(NOT APRICONV_LIB)

  if (NOT APU_LIB)
    message(SEND_ERROR "No aprutil lib found!")
  else (NOT APU_LIB)
    message(STATUS "Found aprutil lib: ${APU_LIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${APU_LIB})
  endif(NOT APU_LIB)

  if (NOT APU_XMLLIB)
    message(SEND_ERROR "No xml lib found!")
  else (NOT APU_XMLLIB)
    message(STATUS "Found xml lib: ${APU_XMLLIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${APU_XMLLIB})
  endif(NOT APU_XMLLIB)

  if (NOT NEON_LIB)
    message(SEND_ERROR "No neon lib found!")
  else (NOT NEON_LIB)
    message(STATUS "Found neon lib: ${NEON_LIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${NEON_LIB})
  endif(NOT NEON_LIB)

  if (NOT NEON_ZLIBSTATLIB)
    message(SEND_ERROR "No zlibstat lib found!")
  else (NOT APRICONV_LIB)
    message(STATUS "Found zlibstat lib: ${NEON_ZLIBSTATLIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${NEON_ZLIBSTATLIB})
  endif(NOT NEON_ZLIBSTATLIB)

  if (NOT INTL3LIB)
    message(SEND_ERROR "No intl3 lib found!")
  else (NOT INTL3LIB)
    message(STATUS "Found intl3 lib: ${INTL3LIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${INTL3LIB})
  endif(NOT INTL3LIB)

  if (NOT DB44_LIB)
    message(SEND_ERROR "No db44 lib found!")
  else (NOT DB44_LIB)
    message(STATUS "Found db44 lib: ${DB44_LIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${DB44_LIB})
  endif(NOT DB44_LIB)

  if (NOT SUBVERSION_DELTALIB)
    message(SEND_ERROR "No subversion delta lib found!")
  else (NOT SUBVERSION_DELTALIB)
    message(STATUS "Found subversion delta lib: ${SUBVERSION_DELTALIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_DELTALIB})
  endif(NOT SUBVERSION_DELTALIB)

  if (NOT SUBVERSION_FSBASELIB)
    message(SEND_ERROR "No subversion fs base lib found!")
  else (NOT SUBVERSION_FSBASELIB)
    message(STATUS "Found subversion fs base lib: ${SUBVERSION_FSBASELIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_FSBASELIB})
  endif(NOT SUBVERSION_FSBASELIB)

  if (NOT SUBVERSION_FSFSLIB)
    message(SEND_ERROR "No subversion fs fs lib found!")
  else (NOT SUBVERSION_FSFSLIB)
    message(STATUS "Found subversion fs fs lib: ${SUBVERSION_FSFSLIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_FSFSLIB})
  endif(NOT SUBVERSION_FSFSLIB)

  if (NOT SUBVERSION_FSUTILLIB)
    message(SEND_ERROR "No subversion fs util lib found!")
  else (NOT SUBVERSION_FSUTILLIB)
    message(STATUS "Found subversion fs util lib: ${SUBVERSION_FSUTILLIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_FSUTILLIB})
  endif(NOT SUBVERSION_FSUTILLIB)

  if (NOT SUBVERSION_RALOCALLIB)
    message(SEND_ERROR "No subversion ra local lib found!")
  else (NOT SUBVERSION_RALOCALLIB)
    message(STATUS "Found subversion ra local lib: ${SUBVERSION_RALOCALLIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_RALOCALLIB})
  endif(NOT SUBVERSION_RALOCALLIB)

  if (NOT SUBVERSION_RANEONLIB)
    message(SEND_ERROR "No subversion ra neon lib found!")
  else (NOT SUBVERSION_RANEONLIB)
    message(STATUS "Found subversion ra neon lib: ${SUBVERSION_RANEONLIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_RANEONLIB})
  endif(NOT SUBVERSION_RANEONLIB)

  if (NOT SUBVERSION_RASVNLIB)
    message(SEND_ERROR "No subversion ra svn lib found!")
  else (NOT SUBVERSION_RASVNLIB)
    message(STATUS "Found subversion ra svn lib: ${SUBVERSION_RASVNLIB}")
    set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_RASVNLIB})
  endif(NOT SUBVERSION_RASVNLIB)

endif (WIN32)


if(NOT SUBVERSION_INCLUDE_DIR)
  message(SEND_ERROR "No subversion includes found!")
else(NOT SUBVERSION_INCLUDE_DIR)
  message(STATUS "Found subversion include: ${SUBVERSION_INCLUDE_DIR}")
endif(NOT SUBVERSION_INCLUDE_DIR)

if (NOT SUBVERSION_CLIENTLIB)
 message(SEND_ERROR "No subversion client libs found!")
else (NOT SUBVERSION_CLIENTLIB)
 message(STATUS "Found subversion client lib: ${SUBVERSION_CLIENTLIB}")
 set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_CLIENTLIB})
endif(NOT SUBVERSION_CLIENTLIB)

if (NOT SUBVERSION_DIFFLIB)
 message(SEND_ERROR "No subversion diff lib found!")
else (NOT SUBVERSION_DIFFLIB)
 message(STATUS "Found subversion diff lib: ${SUBVERSION_DIFFLIB}")
 set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_DIFFLIB})
endif(NOT SUBVERSION_DIFFLIB)

if (NOT SUBVERSION_FSLIB)
 message(SEND_ERROR "No subversion fs lib found!")
else (NOT SUBVERSION_FSLIB)
 message(STATUS "Found subversion fs lib: ${SUBVERSION_FSLIB}")
 set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_FSLIB})
endif(NOT SUBVERSION_FSLIB)

if (NOT SUBVERSION_RALIB)
 message(SEND_ERROR "No subversion ra lib found!")
else (NOT SUBVERSION_RALIB)
 message(STATUS "Found subversion ra lib: ${SUBVERSION_RALIB}")
 set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_RALIB})
endif(NOT SUBVERSION_RALIB)

if (NOT SUBVERSION_REPOSITORYLIB)
 message(SEND_ERROR "No subversion repository lib found!")
else (NOT SUBVERSION_REPOSITORYLIB)
 message(STATUS "Found subversion repository lib: ${SUBVERSION_REPOSITORYLIB}")
 set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_REPOSITORYLIB})
endif(NOT SUBVERSION_REPOSITORYLIB)

if (NOT SUBVERSION_SUBRLIB)
 message(SEND_ERROR "No subversion subr lib found!")
else (NOT SUBVERSION_SUBRLIB)
 message(STATUS "Found subversion subr lib: ${SUBVERSION_SUBRLIB}")
 set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_SUBRLIB})
endif(NOT SUBVERSION_SUBRLIB)

if (NOT SUBVERSION_WCLIB)
 message(SEND_ERROR "No subversion wc lib found!")
else (NOT SUBVERSION_WCLIB)
 message(STATUS "Found subversion wc lib: ${SUBVERSION_WCLIB}")
 set(SUBVERSION_ALL_LIBS ${SUBVERSION_ALL_LIBS} ${SUBVERSION_WCLIB})
endif(NOT SUBVERSION_WCLIB)


set(SUBVERSIONFOUND true)