summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake
blob: 7dd8a1a97639801e545b4fae05abd9f3e55a7dd5 (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
#################################################
#
#  (C) 2010-2011 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

find_file( USE_DB_H_PATH NAMES "db5/db.h" "db4/db.h" "db.h" )

check_c_source_compiles("
    #include <${USE_DB_H_PATH}>
    #include <stddef.h>
    int main() { DB *db; db->open(db, 0, 0, NULL, DB_BTREE, DB_CREATE, 0644); } "
  HAVE_BERKELEY_DB )

if( HAVE_BERKELEY_DB )
  find_library( BDB_LIBRARY db PATH_SUFFIXES db5 db4 )
endif( )

if( NOT BDB_LIBRARY )
  tde_message_fatal( "berkeley db is required, but was not found on your system" )
endif( )