aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorSfan5 <sfan5@live.de>2013-09-09 22:46:18 +0200
committerSfan5 <sfan5@live.de>2013-09-09 22:50:51 +0200
commit3725179736e2b5372664163470e7ef3dc76529a4 (patch)
tree7a56c929ae75530679b3d2f7c9c02fb361760219 /src/CMakeLists.txt
parent1f3402e7a1e160c4be25c596f33d916b988075fb (diff)
downloadminetest-3725179736e2b5372664163470e7ef3dc76529a4.tar.gz
minetest-3725179736e2b5372664163470e7ef3dc76529a4.tar.bz2
minetest-3725179736e2b5372664163470e7ef3dc76529a4.zip
Use system-wide LevelDB instead of bundled one
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 34146186e..6a46a823f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -174,9 +174,6 @@ find_package(Sqlite3 REQUIRED)
find_package(Json REQUIRED)
find_package(OpenGLES2)
-SET(LEVELDB_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/leveldb/include)
-SET(LEVELDB_LIBRARY leveldb)
-
if(USE_FREETYPE)
find_package(Freetype REQUIRED)
set(CGUITTFONT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cguittfont")
@@ -209,9 +206,18 @@ set(USE_LEVELDB 0)
OPTION(ENABLE_LEVELDB "Enable LevelDB backend")
if(ENABLE_LEVELDB)
- set(USE_LEVELDB 1)
- message(STATUS "LevelDB backend enabled")
- include_directories(${LEVELDB_INCLUDE_DIR})
+ find_library(LEVELDB_LIBRARY leveldb)
+ find_path(LEVELDB_INCLUDE_DIR db.h PATH_SUFFIXES leveldb)
+ message (STATUS "LevelDB library: ${LEVELDB_LIBRARY}")
+ message (STATUS "LevelDB headers: ${LEVELDB_INCLUDE_DIR}")
+ if(LEVELDB_LIBRARY AND LEVELDB_INCLUDE_DIR)
+ set(USE_LEVELDB 1)
+ message(STATUS "LevelDB backend enabled")
+ include_directories(${LEVELDB_INCLUDE_DIR})
+ else(LEVELDB_LIBRARY AND LEVELDB_INCLUDE_DIR)
+ set(USE_LEVELDB 0)
+ message(STATUS "LevelDB not found!")
+ endif(LEVELDB_LIBRARY AND LEVELDB_INCLUDE_DIR)
endif(ENABLE_LEVELDB)
configure_file(
@@ -635,7 +641,4 @@ else (JSON_FOUND)
add_subdirectory(json)
endif (JSON_FOUND)
-if (USE_LEVELDB)
- add_subdirectory(leveldb)
-endif (USE_LEVELDB)
#end