diff options
author | Filipe Saraiva <filipe@kde.org> | 2017-03-03 14:49:28 -0300 |
---|---|---|
committer | Filipe Saraiva <filipe@kde.org> | 2017-03-04 17:30:40 -0300 |
commit | e722eaa7546166a5084e0cdeeb481383513b97a6 (patch) | |
tree | fd133105860220a1612c4964fb5300954e792a04 | |
parent | be652c12dfa5162d952f5226de453e1a29957c3a (diff) | |
parent | 020b96e731de12cfeb166f1c457545dd3f8fde23 (diff) | |
download | sink-e722eaa7546166a5084e0cdeeb481383513b97a6.tar.gz sink-e722eaa7546166a5084e0cdeeb481383513b97a6.zip |
Create and add FindLMDB to CMakeLists.txt
Summary:
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.
Test Plan:
Remove LMDB development library and try to compile sink. The CMake
process will end with success but in compilation time you will get
the follow error message sink/common/storage_lmdb.cpp:35:18: fatal
error: lmdb.h: Arquivo ou diretório não encontrado compilation terminated.
After apply the patch, the look for LMDB will work and the CMake
process will fail because there is not LMDB installed.
So, just install LMDB development and the CMake process will find
the library and the process will end successfully.
Reviewers: #sink, cmollekopf
Reviewed By: #sink, cmollekopf
Subscribers: #sink
Tags: #sink
Differential Revision: https://phabricator.kde.org/D4927
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/modules/FindLMDB.cmake | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 84f4df6..532ad41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -29,6 +29,7 @@ find_package(Qt5 COMPONENTS REQUIRED Core Network Gui) | |||
29 | find_package(KF5 COMPONENTS REQUIRED Mime Contacts) | 29 | find_package(KF5 COMPONENTS REQUIRED Mime Contacts) |
30 | find_package(FlatBuffers REQUIRED) | 30 | find_package(FlatBuffers REQUIRED) |
31 | find_package(KAsync REQUIRED 0.1.0) | 31 | find_package(KAsync REQUIRED 0.1.0) |
32 | find_package(LMDB REQUIRED) | ||
32 | 33 | ||
33 | find_program(MEMORYCHECK_COMMAND valgrind) | 34 | find_program(MEMORYCHECK_COMMAND valgrind) |
34 | set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full") | 35 | set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full") |
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 @@ | |||
1 | # Try to find the LMBD libraries and headers | ||
2 | # LMDB_FOUND - system has LMDB lib | ||
3 | # LMDB_INCLUDE_DIR - the LMDB include directory | ||
4 | # LMDB_LIBRARIES - Libraries needed to use LMDB | ||
5 | |||
6 | # FindCWD based on FindGMP by: | ||
7 | # Copyright (c) 2006, Laurent Montel, <montel@kde.org> | ||
8 | # | ||
9 | # Redistribution and use is allowed according to the terms of the BSD license. | ||
10 | |||
11 | # Adapted from FindCWD by: | ||
12 | # Copyright 2013 Conrad Steenberg <conrad.steenberg@gmail.com> | ||
13 | # Aug 31, 2013 | ||
14 | |||
15 | # Adapted from FindLMDB by: | ||
16 | # Copyright 2015 Anatoly Baksheev <anatoly.baksheev@gmail.com> | ||
17 | # Mar 03, 2017 | ||
18 | |||
19 | find_path(LMDB_INCLUDE_DIR NAMES lmdb.h PATHS "$ENV{LMDB_DIR}/include") | ||
20 | find_library(LMDB_LIBRARIES NAMES lmdb PATHS "$ENV{LMDB_DIR}/lib" ) | ||
21 | |||
22 | include(FindPackageHandleStandardArgs) | ||
23 | find_package_handle_standard_args(LMDB DEFAULT_MSG LMDB_INCLUDE_DIR LMDB_LIBRARIES) | ||
24 | |||
25 | if(LMDB_FOUND) | ||
26 | message(STATUS "Found lmdb (include: ${LMDB_INCLUDE_DIR}, library: ${LMDB_LIBRARIES})") | ||
27 | mark_as_advanced(LMDB_INCLUDE_DIR LMDB_LIBRARIES) | ||
28 | |||
29 | set(LMDB_VERSION "${MDB_VERSION_MAJOR}.${MDB_VERSION_MINOR}.${MDB_VERSION_PATCH}") | ||
30 | endif() | ||