From 3725179736e2b5372664163470e7ef3dc76529a4 Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Mon, 9 Sep 2013 22:46:18 +0200 Subject: Use system-wide LevelDB instead of bundled one --- src/CMakeLists.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/CMakeLists.txt') 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 -- cgit v1.2.3