|
| 1 | +# Copyright (c) 2014, The Monero Project |
| 2 | +# All rights reserved. |
| 3 | +# |
| 4 | +# Redistribution and use in source and binary forms, with or without modification, are |
| 5 | +# permitted provided that the following conditions are met: |
| 6 | +# |
| 7 | +# 1. Redistributions of source code must retain the above copyright notice, this list of |
| 8 | +# conditions and the following disclaimer. |
| 9 | +# |
| 10 | +# 2. Redistributions in binary form must reproduce the above copyright notice, this list |
| 11 | +# of conditions and the following disclaimer in the documentation and/or other |
| 12 | +# materials provided with the distribution. |
| 13 | +# |
| 14 | +# 3. Neither the name of the copyright holder nor the names of its contributors may be |
| 15 | +# used to endorse or promote products derived from this software without specific |
| 16 | +# prior written permission. |
| 17 | +# |
| 18 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
| 19 | +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 20 | +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
| 21 | +# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 22 | +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 23 | +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 24 | +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 25 | +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 26 | +# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | + |
| 28 | +MESSAGE(STATUS "Looking for liblmdb") |
| 29 | + |
| 30 | +FIND_PATH(LMDB_INCLUDE_DIR |
| 31 | + NAMES lmdb.h |
| 32 | + PATH_SUFFIXES include/ include/lmdb/ |
| 33 | + PATHS "${PROJECT_SOURCE_DIR}" |
| 34 | + ${LMDB_ROOT} |
| 35 | + $ENV{LMDB_ROOT} |
| 36 | + /usr/local/ |
| 37 | + /usr/ |
| 38 | +) |
| 39 | + |
| 40 | +if(STATIC) |
| 41 | + if(MINGW) |
| 42 | + find_library(LMDB_LIBRARIES liblmdb.dll.a) |
| 43 | + else() |
| 44 | + find_library(LMDB_LIBRARIES liblmdb.a) |
| 45 | + endif() |
| 46 | +else() |
| 47 | + find_library(LMDB_LIBRARIES lmdb) |
| 48 | +endif() |
| 49 | + |
| 50 | +IF(LMDB_INCLUDE_DIR) |
| 51 | + MESSAGE(STATUS "Found liblmdb include (lmdb.h) in ${LMDB_INCLUDE_DIR}") |
| 52 | + IF(LMDB_LIBRARIES) |
| 53 | + MESSAGE(STATUS "Found liblmdb library") |
| 54 | + set(LMDB_INCLUDE ${LMDB_INCLUDE_DIR}) |
| 55 | + set(LMDB_LIBRARY ${LMDB_LIBRARIES}) |
| 56 | + ELSE() |
| 57 | + MESSAGE(FATAL_ERROR "${BoldRed}Could not find liblmdb library, please make sure you have installed liblmdb or liblmdb-dev or the equivalent${ColourReset}") |
| 58 | + ENDIF() |
| 59 | +ELSE() |
| 60 | + MESSAGE(FATAL_ERROR "${BoldRed}Could not find liblmdb library, please make sure you have installed liblmdb or liblmdb-dev or the equivalent${ColourReset}") |
| 61 | +ENDIF() |
0 commit comments