File: FindBDB.cmake

package info (click to toggle)
libical3 3.0.20-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,068 kB
  • sloc: ansic: 37,740; xml: 6,726; cpp: 6,414; python: 2,551; perl: 1,613; java: 1,415; yacc: 1,136; sh: 520; lex: 133; makefile: 46; php: 10
file content (54 lines) | stat: -rw-r--r-- 1,339 bytes parent folder | download | duplicates (4)
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
# Finds the Berkeley DB Library
#
#  BDB_FOUND          - True if Berkeley DB found.
#  BDB_INCLUDE_DIR    - Directory to include to get Berkeley DB headers
#  BDB_LIBRARY        - Library to link against for the Berkeley DB
#

set_package_properties(BDB PROPERTIES
  DESCRIPTION "Berkeley DB storage"
  URL "https://www.oracle.com/database/berkeley-db"
)

if(BDB_INCLUDE_DIR AND BDB_LIBRARY)
  # Already in cache, be silent
  set(BDB_FIND_QUIETLY TRUE)
endif()

# Look for the header file.
find_path(
  BDB_INCLUDE_DIR
  NAMES db.h
  HINTS /usr/local/opt/db/include
  DOC "Include directory for the Berkeley DB library"
)
mark_as_advanced(BDB_INCLUDE_DIR)

# Look for the library.
find_library(
  BDB_LIBRARY
  NAMES db
  HINTS /usr/local/opt/db4/lib
  DOC "Libraries to link against for the Berkeley DB"
)
mark_as_advanced(BDB_LIBRARY)

# Copy the results to the output variables.
if(BDB_INCLUDE_DIR AND BDB_LIBRARY)
  set(BDB_FOUND 1)
else()
  set(BDB_FOUND 0)
endif()

if(BDB_FOUND)
  if(NOT BDB_FIND_QUIETLY)
    message(STATUS "Found Berkeley DB header files in ${BDB_INCLUDE_DIR}")
    message(STATUS "Found Berkeley libraries: ${BDB_LIBRARY}")
  endif()
else()
  if(BDB_FIND_REQUIRED)
    message(FATAL_ERROR "Could not find Berkeley DB")
  else()
    message(STATUS "Optional package Berkeley DB was not found")
  endif()
endif()