aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-03-29 09:03:30 -0400
committerThomas Winget <tewinget@gmail.com>2015-03-29 09:03:30 -0400
commite7391a411372cabbefe3fd46ba667c21cf1fa3b6 (patch)
tree3934f69a876d5f10637c93fc868d5a8f139aa164 /external
parentMerge upstream updates into blockchain branch (diff)
parentSteps toward multiple dbs available -- working (diff)
downloadmonero-e7391a411372cabbefe3fd46ba667c21cf1fa3b6.tar.xz
Merge BerkeleyDB blockchain db implementation
Diffstat (limited to 'external')
-rw-r--r--external/db_drivers/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/external/db_drivers/CMakeLists.txt b/external/db_drivers/CMakeLists.txt
index 5bc27ed1f..b6865a037 100644
--- a/external/db_drivers/CMakeLists.txt
+++ b/external/db_drivers/CMakeLists.txt
@@ -33,3 +33,25 @@ add_subdirectory(liblmdb${ARCH_WIDTH})
set(LMDB_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/liblmdb${ARCH_WIDTH}" CACHE STRING "LMDB Include path")
set(LMDB_LIBRARY "lmdb" CACHE STRING "LMDB Library name")
+
+find_package(BerkeleyDB)
+
+if(NOT BERKELEY_DB_LIBRARIES OR STATIC)
+ add_subdirectory(libdb)
+ message(STATUS "BerkeleyDB not found, building from src tree")
+
+ set(BDB_STATIC true CACHE BOOL "BDB Static flag")
+ set(BDB_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libdb" CACHE STRING "BDB include path")
+ set(BDB_LIBRARY "db" CACHE STRING "BDB library name")
+else()
+ message(STATUS "Found BerkeleyDB include (db.h) in ${BERKELEY_DB_INCLUDE_DIR}")
+ if(BERKELEY_DB_LIBRARIES)
+ message(STATUS "Found BerkeleyDB shared library")
+ set(BDB_STATIC false CACHE BOOL "BDB Static flag")
+ set(BDB_INCLUDE ${BERKELEY_DB_INCLUDE_DIR} CACHE STRING "BDB include path")
+ set(BDB_LIBRARY ${BERKELEY_DB_LIBRARIES} CACHE STRING "BDB library name")
+ set(BDB_LIBRARY_DIRS "" CACHE STRING "BDB Library dirs")
+ else()
+ die("Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev or the equivalent")
+ endif()
+endif()