aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-03-16 09:14:51 -0400
committerThomas Winget <tewinget@gmail.com>2015-03-16 09:14:51 -0400
commit43477b7dac861a83ade364ebb5a5c3da8228b3e4 (patch)
tree8ac746edc7275924353fc8ffbe1556d615b2ccfe /cmake
parentCMake wiring, minor cleanup, minor test addition (diff)
downloadmonero-43477b7dac861a83ade364ebb5a5c3da8228b3e4.tar.xz
BerkeleyDB Blockchain building, not working yet
Everything except actually *using* BlockchainBDB is wired up, but the db itself is not yet working. Some error about user mem not large enough. I think I know what this error means, but I can't determine the cause. Notes: BerkeleyDB does not allow 0-indexing in its recno type databases, so block numbers *in the database* will be 1-indexed. Modifications to indexing have been made as needed.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindBerkeleyDB.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmake/FindBerkeleyDB.cmake b/cmake/FindBerkeleyDB.cmake
new file mode 100644
index 000000000..916d8f9cc
--- /dev/null
+++ b/cmake/FindBerkeleyDB.cmake
@@ -0,0 +1,25 @@
+# - Try to find Berkeley DB
+# Once done this will define
+#
+# BERKELEY_DB_FOUND - system has Berkeley DB
+# BERKELEY_DB_INCLUDE_DIR - the Berkeley DB include directory
+# BERKELEY_DB_LIBRARIES - Link these to use Berkeley DB
+# BERKELEY_DB_DEFINITIONS - Compiler switches required for using Berkeley DB
+
+# Copyright (c) 2006, Alexander Dymo, <adymo@kdevelop.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+find_path(BERKELEY_DB_INCLUDE_DIR db_cxx.h
+ /usr/include/db4
+ /usr/local/include/db4
+)
+
+find_library(BERKELEY_DB_LIBRARIES NAMES db_cxx )
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Berkeley "Could not find Berkeley DB >= 4.1" BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES)
+# show the BERKELEY_DB_INCLUDE_DIR and BERKELEY_DB_LIBRARIES variables only in the advanced view
+mark_as_advanced(BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES )
+