diff --git a/CMakeLists.txt b/CMakeLists.txt index d4be26923..d070ccc1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,10 +105,6 @@ message("-- CXXFLAGS: ${CMAKE_CXX_FLAGS}") # this must be an include, as a function it would messs up with variable scope! include(EthDependencies) - -# TODO this will go away soon! -include(EthDependenciesDeprecated) - createBuildInfo() add_subdirectory(libdevcore) diff --git a/cmake/EthDependencies.cmake b/cmake/EthDependencies.cmake index 7b756c3d5..77cd3bfe7 100644 --- a/cmake/EthDependencies.cmake +++ b/cmake/EthDependencies.cmake @@ -34,18 +34,39 @@ message(" - Jsoncpp lib : ${JSONCPP_LIBRARIES}") # TODO the JsonRpcCpp package does not yet check for correct version number # json-rpc-cpp support is currently not mandatory # TODO make headless client optional +# TODO get rid of -DETH_JSONRPC find_package (JsonRpcCpp 0.3.2) -if (${JSON_RPC_CPP_FOUND}) +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() +# TODO readline package does not yet check for correct version number +# TODO make readline package dependent on cmake options +# TODO get rid of -DETH_READLINE +find_package (Readline 6.3.8) +if (READLINE_FOUND) + message (" - readline header: ${READLINE_INCLUDE_DIR}") + message (" - readline lib : ${READLINE_LIBRARY}") + add_definitions(-DETH_READLINE) +endif () + +# TODO miniupnpc package does not yet check for correct version number +# TODO make miniupnpc package dependent on cmake options +# TODO get rid of -DMINIUPNPC +find_package (Miniupnpc 1.8.2013) +if (MINIUPNPC_FOUND) + message (" - miniupnpc header: ${MINIUPNPC_INCLUDE_DIR}") + message (" - miniupnpc lib : ${MINIUPNPC_LIBRARY}") + add_definitions(-DETH_MINIUPNPC) +endif() + # TODO gmp package does not yet check for correct version number # TODO it is also not required in msvc build find_package (Gmp 6.0.0) -message(" - Gmp Header: ${GMP_INCLUDE_DIR}") -message(" - Gmp lib : ${GMP_LIBRARY}") +message(" - gmp Header: ${GMP_INCLUDE_DIR}") +message(" - gmp lib : ${GMP_LIBRARY}") # TODO make headless client optional find_package (QT5Core REQUIRED) @@ -57,7 +78,6 @@ find_package (Qt5Widgets REQUIRED) find_package (Qt5WebKit REQUIRED) find_package (Qt5WebKitWidgets REQUIRED) - # we have to specify here if we want static and boost version, that is really important set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) @@ -72,19 +92,8 @@ find_package(Boost 1.55.0 REQUIRED COMPONENTS thread date_time system regex chro message(" - boost header: ${Boost_INCLUDE_DIRS}") message(" - boost lib : ${Boost_LIBRARIES}") - - - - - - - - - - - - - - - +if (APPLE) + link_directories(/usr/local/lib) + include_directories(/usr/local/include) +endif() diff --git a/cmake/EthDependenciesDeprecated.cmake b/cmake/EthDependenciesDeprecated.cmake deleted file mode 100644 index 72ad9c769..000000000 --- a/cmake/EthDependenciesDeprecated.cmake +++ /dev/null @@ -1,110 +0,0 @@ -# search for and configure dependencies - -# deprecated. DO NOT ADD any new stuff here. Proper dependency fetching is done in EthDependencies.cmake - - -if("${TARGET_PLATFORM}" STREQUAL "w64") -# set(MINIUPNPC_LS /usr/x86_64-w64-mingw32/lib/libminiupnpc.a) -else() - - find_path( PYTHON_ID pyconfig.h - ${PYTHON_INCLUDE_DIR} - /usr/include/python2.7 - /usr/local/include/python2.7 - ) - if ( PYTHON_ID STREQUAL "PYTHON_ID-NOTFOUND" ) - message(STATUS "Failed to find the Python-2.7 headers") - else () - message(STATUS "Found Python-2.7 Headers: ${PYTHON_ID}") - - # Check for accessory dev libraries leveldb and miniupnpc - find_library( PYTHON_LS NAMES python2.7 - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ) - if ( PYTHON_LS STREQUAL "PYTHON_LS-NOTFOUND" ) - message(STATUS "Failed to find the Python-2.7 Library!") - set(PYTHON_ID) - set(PYTHON_LS) - else () - message(STATUS "Found Python-2.7 Library: ${PYTHON_LS}") - add_definitions(-DETH_PYTHON) - endif () - endif () - - find_path( MINIUPNPC_ID miniupnpc/miniwget.h - /usr/include - /usr/local/include - ) - if ( MINIUPNPC_ID ) - message(STATUS "Found miniupnpc headers") - - find_library( MINIUPNPC_LS NAMES miniupnpc - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ) - if ( MINIUPNPC_LS ) - message(STATUS "Found miniupnpc library: ${MINIUPNPC_LS}") - add_definitions(-DETH_MINIUPNPC) - else () - message(STATUS "Failed to find the miniupnpc library!") - endif () - else () - message(STATUS "Failed to find the miniupnpc headers!") - endif () - - find_path( READLINE_ID readline/readline.h - /usr/include - /usr/local/include - ) - if ( READLINE_ID ) - message(STATUS "Found readline headers") - find_library( READLINE_LS NAMES readline - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ) - if ( READLINE_LS ) - message(STATUS "Found readline library: ${READLINE_LS}") - add_definitions(-DETH_READLINE) - else () - message(STATUS "Failed to find the readline library!") - endif () - else () - message(STATUS "Failed to find the readline headers!") - endif () - - #if (LANGUAGES) - # find_package(Boost 1.53 REQUIRED COMPONENTS thread date_time) - #else() - # find_package(Boost 1.53 REQUIRED COMPONENTS thread date_time system regex) - #endif() - - set(QTQML 1) -endif() - -if(PYTHON_ID) - include_directories(${PYTHON_ID}) -endif() -if(MINIUPNPC_ID) - include_directories(${MINIUPNPC_ID}) -endif() -if(READLINE_ID) - include_directories(${READLINE_ID}) -endif() - - - - -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - link_directories(/usr/local/lib) - include_directories(/usr/local/include) -endif() diff --git a/cmake/FindGmp.cmake b/cmake/FindGmp.cmake index 908499865..4d7a3a04c 100644 --- a/cmake/FindGmp.cmake +++ b/cmake/FindGmp.cmake @@ -6,8 +6,8 @@ # # This module defines # GMP_INCLUDE_DIR, where to find header, etc. -# GMP_LIBRARY, the libraries needed to use leveldb. -# GMP_FOUND, If false, do not try to use leveldb. +# GMP_LIBRARY, the libraries needed to use gmp. +# GMP_FOUND, If false, do not try to use gmp. # only look in default directories find_path( @@ -22,7 +22,6 @@ find_library( DOC "gmp library" ) - # handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE # if all listed variables are TRUE, hide their existence from configuration view include(FindPackageHandleStandardArgs) diff --git a/cmake/FindMiniupnpc.cmake b/cmake/FindMiniupnpc.cmake new file mode 100644 index 000000000..90a202dce --- /dev/null +++ b/cmake/FindMiniupnpc.cmake @@ -0,0 +1,31 @@ +# Find miniupnpc +# +# Find the miniupnpc includes and library +# +# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH +# +# This module defines +# MINIUPNPC_INCLUDE_DIR, where to find header, etc. +# MINIUPNPC_LIBRARY, the libraries needed to use gmp. +# MINIUPNPC_FOUND, If false, do not try to use gmp. + +# only look in default directories +find_path( + MINIUPNPC_INCLUDE_DIR + NAMES miniupnpc/miniupnpc.h + DOC "miniupnpc include dir" + ) + +find_library( + MINIUPNPC_LIBRARY + NAMES miniupnpc + DOC "miniupnpc library" + ) + +# handle the QUIETLY and REQUIRED arguments and set MINIUPNPC_FOUND to TRUE +# if all listed variables are TRUE, hide their existence from configuration view +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(miniupnpc DEFAULT_MSG + MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY) +mark_as_advanced (MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY) + diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake new file mode 100644 index 000000000..16eb483ee --- /dev/null +++ b/cmake/FindReadline.cmake @@ -0,0 +1,31 @@ +# Find readline +# +# Find the readline includes and library +# +# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH +# +# This module defines +# READLINE_INCLUDE_DIR, where to find header, etc. +# READLINE_LIBRARY, the libraries needed to use readline. +# READLINE_FOUND, If false, do not try to use readline. + +# only look in default directories +find_path( + READLINE_INCLUDE_DIR + NAMES readline/readline.h + DOC "readling include dir" + ) + +find_library( + READLINE_LIBRARY + NAMES readline + DOC "readline library" + ) + +# handle the QUIETLY and REQUIRED arguments and set READLINE_FOUND to TRUE +# if all listed variables are TRUE, hide their existence from configuration view +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(readline DEFAULT_MSG + READLINE_INCLUDE_DIR READLINE_LIBRARY) +mark_as_advanced (READLINE_INCLUDE_DIR READLINE_LIBRARY) + diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index 575c045d8..fe5571f60 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -17,16 +17,16 @@ add_dependencies(${EXECUTABLE} BuildInfo.h) target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY_RELEASE}) target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY_RELEASE}) -if(MINIUPNPC_LS) - target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if(MINIUPNPC_FOUND) + target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() if(JSON_RPC_CPP_FOUND) target_link_libraries(${EXECUTABLE} web3jsonrpc) endif() -if(READLINE_LS) -target_link_libraries(${EXECUTABLE} ${READLINE_LS}) +if (READLINE_FOUND) +target_link_libraries(${EXECUTABLE} ${READLINE_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} webthree) diff --git a/exp/CMakeLists.txt b/exp/CMakeLists.txt index 6fcea5341..1cd5218e2 100644 --- a/exp/CMakeLists.txt +++ b/exp/CMakeLists.txt @@ -12,8 +12,8 @@ add_executable(${EXECUTABLE} ${SRC_LIST}) target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if(MINIUPNPC_FOUND) +target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} ethereum) diff --git a/libethereum/CMakeLists.txt b/libethereum/CMakeLists.txt index e9904e9a8..ac5bd7136 100644 --- a/libethereum/CMakeLists.txt +++ b/libethereum/CMakeLists.txt @@ -21,8 +21,8 @@ endif() target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY_RELEASE}) -if (MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if (MINIUPNPC_FOUND) +target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} evm) diff --git a/libevm/CMakeLists.txt b/libevm/CMakeLists.txt index 778bce8d9..717904912 100644 --- a/libevm/CMakeLists.txt +++ b/libevm/CMakeLists.txt @@ -19,8 +19,8 @@ endif() target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if(MINIUPNPC_FOUND) +target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} ethcore) diff --git a/libp2p/CMakeLists.txt b/libp2p/CMakeLists.txt index fa7ff6a54..e354a1c65 100644 --- a/libp2p/CMakeLists.txt +++ b/libp2p/CMakeLists.txt @@ -18,8 +18,8 @@ else() endif() target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if(MINIUPNPC_FOUND) +target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} devcrypto) diff --git a/libweb3jsonrpc/CMakeLists.txt b/libweb3jsonrpc/CMakeLists.txt index 9925b9026..133471d18 100644 --- a/libweb3jsonrpc/CMakeLists.txt +++ b/libweb3jsonrpc/CMakeLists.txt @@ -22,8 +22,8 @@ target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${JSON_RPC_CPP_COMMON_LIBRARY}) target_link_libraries(${EXECUTABLE} ${JSON_RPC_CPP_SERVER_LIBRARY}) -if (MINIUPNPC_LS) - target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if (MINIUPNPC_FOUND) + target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} webthree) diff --git a/libwebthree/CMakeLists.txt b/libwebthree/CMakeLists.txt index 2e305a5be..09fe7f736 100644 --- a/libwebthree/CMakeLists.txt +++ b/libwebthree/CMakeLists.txt @@ -19,8 +19,8 @@ endif() target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if(MINIUPNPC_FOUND) +target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} ethereum) diff --git a/libwhisper/CMakeLists.txt b/libwhisper/CMakeLists.txt index 51908ffcf..3ab2f6097 100644 --- a/libwhisper/CMakeLists.txt +++ b/libwhisper/CMakeLists.txt @@ -19,8 +19,8 @@ endif() target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if(MINIUPNPC_FOUND) +target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} ethcore) diff --git a/neth/CMakeLists.txt b/neth/CMakeLists.txt index 46195a1eb..4dd49874d 100644 --- a/neth/CMakeLists.txt +++ b/neth/CMakeLists.txt @@ -14,8 +14,8 @@ target_link_libraries(${EXECUTABLE} webthree) target_link_libraries(${EXECUTABLE} ethereum) target_link_libraries(${EXECUTABLE} secp256k1) target_link_libraries(${EXECUTABLE} gmp) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +if(MINIUPNPC_FOUND) +target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARY}) endif() target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARY}) if(JSON_RPC_CPP_FOUND)