aboutsummaryrefslogtreecommitdiff
path: root/external/db_drivers/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-03-17 19:52:53 -0400
committerThomas Winget <tewinget@gmail.com>2015-03-17 19:52:53 -0400
commit8e3347f31096fa26d88cb14582c866e8db785059 (patch)
tree779c958bad8cd3b50365b2a18ee93425bf4fb920 /external/db_drivers/CMakeLists.txt
parentBlockchainBDB passes unit tests (diff)
parentMerges PR #35 (diff)
downloadmonero-8e3347f31096fa26d88cb14582c866e8db785059.tar.xz
Pull blockchain changes into berkeleydb branch
Diffstat (limited to 'external/db_drivers/CMakeLists.txt')
-rw-r--r--external/db_drivers/CMakeLists.txt40
1 files changed, 13 insertions, 27 deletions
diff --git a/external/db_drivers/CMakeLists.txt b/external/db_drivers/CMakeLists.txt
index f90f9f136..b6865a037 100644
--- a/external/db_drivers/CMakeLists.txt
+++ b/external/db_drivers/CMakeLists.txt
@@ -26,27 +26,13 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-find_package(LMDB)
+# We aren't even going to check the system for an installed LMDB driver, as it is too
+# critical a consensus component to rely on dynamically linked libraries
+message(STATUS "Using ${ARCH_WIDTH}-bit LMDB from source tree")
+add_subdirectory(liblmdb${ARCH_WIDTH})
+set(LMDB_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/liblmdb${ARCH_WIDTH}" CACHE STRING "LMDB Include path")
-if(NOT LMDB_LIBRARIES OR STATIC)
- add_subdirectory(liblmdb)
- message(STATUS "lmdb not found, building from src tree")
-
- set(LMDB_STATIC true PARENT_SCOPE)
- set(LMDB_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/liblmdb" PARENT_SCOPE)
- set(LMDB_LIBRARY "lmdb" PARENT_SCOPE)
-else()
- message(STATUS "Found liblmdb include (lmdb.h) in ${LMDB_INCLUDE_DIR}")
- if(LMDB_LIBRARIES)
- message(STATUS "Found liblmdb shared library")
- set(LMDB_STATIC false PARENT_SCOPE)
- set(LMDB_INCLUDE ${LMDB_INCLUDE_DIR} PARENT_SCOPE)
- set(LMDB_LIBRARY ${LMDB_LIBRARIES} PARENT_SCOPE)
- set(LMDB_LIBRARY_DIRS "" PARENT_SCOPE)
- else()
- die("Found liblmdb includes, but could not find liblmdb library. Please make sure you have installed liblmdb and liblmdb-dev or the equivalent")
- endif()
-endif()
+set(LMDB_LIBRARY "lmdb" CACHE STRING "LMDB Library name")
find_package(BerkeleyDB)
@@ -54,17 +40,17 @@ if(NOT BERKELEY_DB_LIBRARIES OR STATIC)
add_subdirectory(libdb)
message(STATUS "BerkeleyDB not found, building from src tree")
- set(BDB_STATIC true PARENT_SCOPE)
- set(BDB_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libdb" PARENT_SCOPE)
- set(BDB_LIBRARY "db" PARENT_SCOPE)
+ 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 PARENT_SCOPE)
- set(BDB_INCLUDE ${BERKELEY_DB_INCLUDE_DIR} PARENT_SCOPE)
- set(BDB_LIBRARY ${BERKELEY_DB_LIBRARIES} PARENT_SCOPE)
- set(BDB_LIBRARY_DIRS "" PARENT_SCOPE)
+ 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()