From 020b96e731de12cfeb166f1c457545dd3f8fde23 Mon Sep 17 00:00:00 2001 From: Filipe Saraiva Date: Fri, 3 Mar 2017 14:49:28 -0300 Subject: Create and add FindLMDB to CMakeLists.txt Currently CMakeLists doesn't look for LMDB, a required dependency for sink. This commit creates a FindLMDB script based in an original script available in BSD license and add it to CMakeLists.txt. --- cmake/modules/FindLMDB.cmake | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmake/modules/FindLMDB.cmake (limited to 'cmake/modules/FindLMDB.cmake') diff --git a/cmake/modules/FindLMDB.cmake b/cmake/modules/FindLMDB.cmake new file mode 100644 index 0000000..d0681ee --- /dev/null +++ b/cmake/modules/FindLMDB.cmake @@ -0,0 +1,30 @@ +# Try to find the LMBD libraries and headers +# LMDB_FOUND - system has LMDB lib +# LMDB_INCLUDE_DIR - the LMDB include directory +# LMDB_LIBRARIES - Libraries needed to use LMDB + +# FindCWD based on FindGMP by: +# Copyright (c) 2006, Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. + +# Adapted from FindCWD by: +# Copyright 2013 Conrad Steenberg +# Aug 31, 2013 + +# Adapted from FindLMDB by: +# Copyright 2015 Anatoly Baksheev +# Mar 03, 2017 + +find_path(LMDB_INCLUDE_DIR NAMES lmdb.h PATHS "$ENV{LMDB_DIR}/include") +find_library(LMDB_LIBRARIES NAMES lmdb PATHS "$ENV{LMDB_DIR}/lib" ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LMDB DEFAULT_MSG LMDB_INCLUDE_DIR LMDB_LIBRARIES) + +if(LMDB_FOUND) + message(STATUS "Found lmdb (include: ${LMDB_INCLUDE_DIR}, library: ${LMDB_LIBRARIES})") + mark_as_advanced(LMDB_INCLUDE_DIR LMDB_LIBRARIES) + + set(LMDB_VERSION "${MDB_VERSION_MAJOR}.${MDB_VERSION_MINOR}.${MDB_VERSION_PATCH}") +endif() -- cgit v1.2.3 From fc608f64ceaf6c040564f5c572c4ff600d76be7e Mon Sep 17 00:00:00 2001 From: Filipe Saraiva Date: Sat, 4 Mar 2017 17:37:33 -0300 Subject: Remove unnecessary message in FindLMDB --- cmake/modules/FindLMDB.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'cmake/modules/FindLMDB.cmake') diff --git a/cmake/modules/FindLMDB.cmake b/cmake/modules/FindLMDB.cmake index d0681ee..bd29036 100644 --- a/cmake/modules/FindLMDB.cmake +++ b/cmake/modules/FindLMDB.cmake @@ -23,7 +23,6 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LMDB DEFAULT_MSG LMDB_INCLUDE_DIR LMDB_LIBRARIES) if(LMDB_FOUND) - message(STATUS "Found lmdb (include: ${LMDB_INCLUDE_DIR}, library: ${LMDB_LIBRARIES})") mark_as_advanced(LMDB_INCLUDE_DIR LMDB_LIBRARIES) set(LMDB_VERSION "${MDB_VERSION_MAJOR}.${MDB_VERSION_MINOR}.${MDB_VERSION_PATCH}") -- cgit v1.2.3