Browse Source

WIP: Cryptopp and json-rpc-cpp correctly downloading and compiling on

Linux. Main cpp-ethereum buildfile finds dependencies, but does not
compile yet
cl-refactor
sveneh 10 years ago
parent
commit
8ee3e56e0a
  1. 3
      CMakeLists.txt
  2. 15
      cmake/EthDependencies.cmake
  3. 26
      cmake/EthDependenciesDeprecated.cmake
  4. 2
      cmake/FindCryptoPP.cmake
  5. 12
      cmake/FindJsonRpcCpp.cmake
  6. 5
      extdep/CMakeLists.txt
  7. 2
      extdep/FindCURL.cmake
  8. 16
      extdep/curl.cmake
  9. 11
      extdep/json-rpc-cpp.cmake

3
CMakeLists.txt

@ -149,9 +149,6 @@ if (NOT LANGUAGES)
if ("${TARGET_PLATFORM}" STREQUAL "w64")
cmake_policy(SET CMP0020 NEW)
endif ()
if (NOT JSONRPC_LS)
message(FATAL_ERROR "Alethzero requires jsonrpc.")
endif()
add_subdirectory(libjsqrc)
add_subdirectory(libqethereum)

15
cmake/EthDependencies.cmake

@ -1,11 +1,18 @@
# all dependencies that are not directly included in the cpp-ethereum distribution are defined here
# for this to work, download the dependency via the cmake script in extdep or install them manually!
set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install")
# by defining this variable, cmake will look for dependencies first in our own repository before looking in system paths like /usr/local/ ...
# this must be set to point to the same directory as $ETH_DEPENDENCY_INSTALL_DIR in /extdep directory
set (CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install")
set (CRYPTOPP_ROOT_DIR ${ETH_DEPENDENCY_INSTALL_DIR})
find_package (CryptoPP 5.6.2 REQUIRED)
message("-- CryptoPP header: ${CRYPTOPP_INCLUDE_DIRS}")
message("-- CryptoPP libs : ${CRYPTOPP_LIBRARIES}")
message(" - CryptoPP header: ${CRYPTOPP_INCLUDE_DIRS}")
message(" - CryptoPP lib : ${CRYPTOPP_LIBRARIES}")
find_package (JsonRpcCpp REQUIRED)
if (${JSON_RPC_CPP_FOUND})
message (" - json-rpc-cpp header: ${JSON_RPC_CPP_INCLUDE_DIRS}")
message (" - json-rpc-cpp lib : ${JSON_RPC_CPP_LIBRARIES}")
add_definitions(-DETH_JSONRPC)
endif()

26
cmake/EthDependenciesDeprecated.cmake

@ -85,29 +85,6 @@ else()
message(STATUS "Failed to find the miniupnpc headers!")
endif ()
find_path( JSONRPC_ID jsonrpc/rpc.h
/usr/include
/usr/local/include
)
if ( JSONRPC_ID )
message(STATUS "Found jsonrpc headers")
find_library( JSONRPC_LS NAMES jsonrpc
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/usr/lib/*/
)
if ( JSONRPC_LS )
message(STATUS "Found jsonrpc library: ${JSONRPC_LS}")
add_definitions(-DETH_JSONRPC)
else ()
message(STATUS "Failed to find the jsonrpc library!")
endif ()
else ()
message(STATUS "Failed to find the jsonrpc headers!")
endif ()
find_path( READLINE_ID readline/readline.h
/usr/include
/usr/local/include
@ -152,9 +129,6 @@ endif()
if(READLINE_ID)
include_directories(${READLINE_ID})
endif()
if(JSONRPC_ID)
include_directories(${JSONRPC_ID})
endif()

2
cmake/FindCryptoPP.cmake

@ -104,5 +104,5 @@ SET (CRYPTOPP_LIBRARIES ${CRYPTOPP_LIBRARY})
MARK_AS_ADVANCED (CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY CRYPTOPP_LIBRARY_DEBUG
CRYPTOPP_LIBRARY_RELEASE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS (CryptoPP REQUIRED_VARS CRYPTOPP_ROOT_DIR
FIND_PACKAGE_HANDLE_STANDARD_ARGS (CryptoPP REQUIRED_VARS
CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY VERSION_VAR CRYPTOPP_VERSION)

12
cmake/FindJsonRcpCpp.cmake → cmake/FindJsonRpcCpp.cmake

@ -9,12 +9,6 @@
# JSON_RCP_CPP_LIBRARIES, the libraries needed to use jsoncpp.
# JSON_RCP_CPP_FOUND, If false, do not try to use jsoncpp.
if (JSON_RPC_CPP_LIBRARIES AND JSON_RPC_CPP_INCLUDE_DIRS)
# in cache already
set(JSON_RPC_CPP_FOUND TRUE)
endif()
# only look in default directories
find_path(
JSON_RPC_CPP_INCLUDE_DIR
@ -32,10 +26,14 @@ find_library(
set (JSON_RPC_CPP_INCLUDE_DIRS ${JSON_RPC_CPP_INCLUDE_DIR})
set (JSON_RPC_CPP_LIBRARIES ${JSON_RPC_CPP_LIBRARY})
# message (" - json-rcp-cpp header : ${JSON_RPC_CPP_INCLUDE_DIRS}")
# message (" - json-rcp-cpp lib : ${JSON_RPC_CPP_LIBRARIES}")
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(json-rpc-cpp DEFAULT_MSG
find_package_handle_standard_args(json_rpc_cpp DEFAULT_MSG
JSON_RPC_CPP_LIBRARY JSON_RPC_CPP_INCLUDE_DIR)

5
extdep/CMakeLists.txt

@ -2,13 +2,12 @@ cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
# dependencies will be installed into this directory
# all dependencies will be installed into this directory
set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install")
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR})
include(cryptopp.cmake)
include(curl.cmake)
include(json-rpc-cpp.cmake)
include(miniupnpc.cmake)
#include(miniupnpc.cmake)

2
extdep/FindCURL.cmake

@ -1,4 +1,4 @@
# hacky way to resolve nested dependencies
# hacky way to resolve nested dependencies - needed for json-rpc-cpp
find_library(CURL_LIBRARY NAMES curl
PATHS
${ETH_DEPENDENCY_INSTALL_DIR}/lib

16
extdep/curl.cmake

@ -1,12 +1,20 @@
set (CONFIG_CMD ./configure --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR})
if(${APPLE})
ExternalProject_Add(curl
set(CONFIG_CMD ./configure --with-darwinssl --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR})
endif()
ExternalProject_Add(
curl
URL http://curl.haxx.se/download/curl-7.38.0.tar.bz2
BINARY_DIR curl-prefix/src/curl
CONFIGURE_COMMAND ./configure --with-darwinssl --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR}
CONFIGURE_COMMAND ${CONFIG_CMD}
BUILD_COMMAND make -j 3
INSTALL_COMMAND make install
)
else()
endif()

11
extdep/json-rpc-cpp.cmake

@ -0,0 +1,11 @@
ExternalProject_Add(json-rpc-cpp
DEPENDS curl
GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git
GIT_TAG eaca2481e2889d5a5b748383fb02b1d395969cd4
BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp
CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR} -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev .
BUILD_COMMAND make jsonrpc -j 3
INSTALL_COMMAND make install
)
Loading…
Cancel
Save