aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
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