PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/cmake/FindBerkeleyDB.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 50 lines | 32 code | 8 blank | 10 comment | 0 complexity | 8b747bfcf0cdbc94f296b1518e4d6991 MD5 | raw file
 1# -*- cmake -*-
 2
 3# - Find BerkeleyDB
 4# Find the BerkeleyDB includes and library
 5# This module defines
 6#  DB_INCLUDE_DIR, where to find db.h, etc.
 7#  DB_LIBRARIES, the libraries needed to use BerkeleyDB.
 8#  DB_FOUND, If false, do not try to use BerkeleyDB.
 9# also defined, but not for general use are
10#  DB_LIBRARY, where to find the BerkeleyDB library.
11
12FIND_PATH(DB_INCLUDE_DIR db.h
13/usr/local/include/db4
14/usr/local/include
15/usr/include/db4
16/usr/include
17)
18
19SET(DB_NAMES ${DB_NAMES} db)
20FIND_LIBRARY(DB_LIBRARY
21  NAMES ${DB_NAMES}
22  PATHS /usr/lib /usr/local/lib
23  )
24
25IF (DB_LIBRARY AND DB_INCLUDE_DIR)
26    SET(DB_LIBRARIES ${DB_LIBRARY})
27    SET(DB_FOUND "YES")
28ELSE (DB_LIBRARY AND DB_INCLUDE_DIR)
29  SET(DB_FOUND "NO")
30ENDIF (DB_LIBRARY AND DB_INCLUDE_DIR)
31
32
33IF (DB_FOUND)
34   IF (NOT DB_FIND_QUIETLY)
35      MESSAGE(STATUS "Found BerkeleyDB: ${DB_LIBRARIES}")
36   ENDIF (NOT DB_FIND_QUIETLY)
37ELSE (DB_FOUND)
38   IF (DB_FIND_REQUIRED)
39      MESSAGE(FATAL_ERROR "Could not find BerkeleyDB library")
40   ENDIF (DB_FIND_REQUIRED)
41ENDIF (DB_FOUND)
42
43# Deprecated declarations.
44SET (NATIVE_DB_INCLUDE_PATH ${DB_INCLUDE_DIR} )
45GET_FILENAME_COMPONENT (NATIVE_DB_LIB_PATH ${DB_LIBRARY} PATH)
46
47MARK_AS_ADVANCED(
48  DB_LIBRARY
49  DB_INCLUDE_DIR
50  )