Browse Source

leveldb on windows

cl-refactor
debris 10 years ago
parent
commit
859cbb451d
  1. 6
      cmake/EthDependencies.cmake
  2. 35
      cmake/FindLevelDB.cmake
  3. 1
      extdep/CMakeLists.txt
  4. 6
      extdep/leveldb.cmake

6
cmake/EthDependencies.cmake

@ -13,6 +13,12 @@ find_package (CryptoPP 5.6.2 EXACT REQUIRED)
message(" - CryptoPP header: ${CRYPTOPP_INCLUDE_DIRS}")
message(" - CryptoPP lib : ${CRYPTOPP_LIBRARIES}")
# TODO the Jsoncpp package does not yet check for correct version number
find_package (LevelDB REQUIRED)
message(" - LevelDB header: ${LEVELDB_INCLUDE_DIR}")
message(" - LevelDB lib: ${LEVELDB_LIBRARY}")
# TODO the Jsoncpp package does not yet check for correct version number
find_package (Jsoncpp 0.60 EXACT REQUIRED)
message(" - Jsoncpp header: ${JSONCPP_INCLUDE_DIRS}")

35
cmake/FindLevelDB.cmake

@ -0,0 +1,35 @@
# Find leveldb
#
# Find the leveldb includes and library
#
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH
#
# This module defines
# LEVELDB_INCLUDE_DIR, where to find header, etc.
# LEVELDB_LIBRARY, the libraries needed to use leveldb.
# LEVELDB_FOUND, If false, do not try to use leveldb.
# only look in default directories
find_path(
LEVELDB_INCLUDE_DIR
NAMES leveldb/db.h
DOC "leveldb include dir"
)
find_library(
LEVELDB_LIBRARY
NAMES leveldb
DOC "leveldb library"
)
# message (" - leveldb header : ${LEVELDB_INCLUDE_DIR}")
# message (" - leveldb lib : ${LEVELDB_LIBRARY}")
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE
# if all listed variables are TRUE, hide their existence from configuration view
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(leveldb DEFAULT_MSG
LEVELDB_INCLUDE_DIR LEVELDB_LIBRARY)
mark_as_advanced (LEVELDB_INCLUDE_DIR LEVELDB_LIBRARY)

1
extdep/CMakeLists.txt

@ -17,6 +17,5 @@ include(snappy.cmake)
include(leveldb.cmake)
# will be re-eanbled later
# include(curl.cmake)
# include(miniupnpc.cmake)

6
extdep/leveldb.cmake

@ -9,12 +9,12 @@ ExternalProject_Add(leveldb
)
elseif(WIN32)
ExternalProject_Add(leveldb
GIT_REPOSITORY https://code.google.com/p/leveldb
GIT_TAG windows
GIT_REPOSITORY https://github.com/debris/leveldb-win32.git
GIT_TAG master
BINARY_DIR leveldb-prefix/src/leveldb
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
INSTALL_COMMAND cmd /c cp lib/LibLevelDB.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib/leveldb.lib && cp -R include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include
)
else()

Loading…
Cancel
Save