Browse Source

Better building. Don't need JSON-RPC now.

cl-refactor
Gav Wood 11 years ago
parent
commit
8b82d27851
  1. 53
      CMakeLists.txt
  2. 61
      eth/CMakeLists.txt
  3. 8
      libethcore/CMakeLists.txt
  4. 7
      libethereum/CMakeLists.txt
  5. 55
      neth/CMakeLists.txt

53
CMakeLists.txt

@ -143,9 +143,9 @@ else ()
/usr/include
/usr/local/include
)
if ( LEVELDB_ID )
if ( LEVELDB_ID )
message(STATUS "Found LevelDB Headers")
else ()
else ()
message(FATAL_ERROR "Failed to find the LevelDB headers")
endif ()
@ -164,8 +164,8 @@ else ()
endif ()
find_path( MINIUPNPC_ID miniupnpc/miniwget.h
/usr/include/miniupnpc
/usr/local/include/miniupnpc
/usr/include
/usr/local/include
)
if ( MINIUPNPC_ID )
message(STATUS "Found miniupnpc headers")
@ -186,6 +186,51 @@ else ()
message(FATAL_ERROR "Failed to find the miniupnpc library!")
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}")
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
)
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}")
else ()
message(STATUS "Failed to find the readline library!")
endif ()
else ()
message(STATUS "Failed to find the readline headers!")
endif ()
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

61
eth/CMakeLists.txt

@ -6,45 +6,52 @@ include_directories(..)
link_directories(../libethcore)
link_directories(../libethereum)
add_executable(eth ${SRC_LIST})
set(EXECUTABLE eth)
add_executable(${EXECUTABLE} ${SRC_LIST})
if (JSONRPC_LS)
add_definitions(-DETH_JSONRPC)
include_directories(${JSONRPC_ID})
target_link_libraries(${EXECUTABLE} ${JSONRPC_LS})
endif ()
if (READLINE_LS)
add_definitions(-DETH_READLINE)
include_directories(${READLINE_ID})
target_link_libraries(${EXECUTABLE} ${READLINE_LS})
endif ()
if (${TARGET_PLATFORM} STREQUAL "w64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
target_link_libraries(eth gcc)
target_link_libraries(eth gdi32)
target_link_libraries(eth ws2_32)
target_link_libraries(eth mswsock)
target_link_libraries(eth shlwapi)
target_link_libraries(eth iphlpapi)
target_link_libraries(eth cryptopp)
target_link_libraries(eth form)
target_link_libraries(eth boost_system-mt-s)
target_link_libraries(eth boost_filesystem-mt-s)
target_link_libraries(eth boost_thread_win32-mt-s)
target_link_libraries(${EXECUTABLE} gcc)
target_link_libraries(${EXECUTABLE} gdi32)
target_link_libraries(${EXECUTABLE} ws2_32)
target_link_libraries(${EXECUTABLE} mswsock)
target_link_libraries(${EXECUTABLE} shlwapi)
target_link_libraries(${EXECUTABLE} iphlpapi)
target_link_libraries(${EXECUTABLE} cryptopp)
target_link_libraries(${EXECUTABLE} boost_system-mt-s)
target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s)
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX)
add_definitions(-DETH_JSONRPC)
add_definitions(-DETH_READLINE)
target_link_libraries(eth jsonrpc)
target_link_libraries(eth readline)
target_link_libraries(eth form)
else ()
target_link_libraries(eth ${CRYPTOPP_LIBRARIES})
target_link_libraries(eth boost_system)
target_link_libraries(eth boost_filesystem)
target_link_libraries(eth form)
target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES})
target_link_libraries(${EXECUTABLE} boost_system)
target_link_libraries(${EXECUTABLE} boost_filesystem)
find_package(Threads REQUIRED)
target_link_libraries(eth ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include_directories(/usr/local/include)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(eth ethereum)
target_link_libraries(eth miniupnpc)
target_link_libraries(eth leveldb)
target_link_libraries(eth gmp)
target_link_libraries(${EXECUTABLE} ethereum)
target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS})
target_link_libraries(${EXECUTABLE} ${LEVELDB_LS})
target_link_libraries(${EXECUTABLE} gmp)
install( TARGETS eth DESTINATION bin )
install( TARGETS ${EXECUTABLE} DESTINATION bin )

8
libethcore/CMakeLists.txt

@ -18,10 +18,12 @@ endif()
file(GLOB HEADERS "*.h")
include_directories(..)
include_directories(${MINIUPNPC_ID})
include_directories(${LEVELDB_ID})
target_link_libraries(${EXECUTABLE} secp256k1)
target_link_libraries(${EXECUTABLE} miniupnpc)
target_link_libraries(${EXECUTABLE} leveldb)
target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS})
target_link_libraries(${EXECUTABLE} ${LEVELDB_LS})
target_link_libraries(${EXECUTABLE} gmp)
@ -49,8 +51,6 @@ elseif (UNIX)
target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY})
target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY})
target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY})
target_link_libraries(${EXECUTABLE} leveldb)
# target_link_libraries(${EXECUTABLE} snappy)
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
else ()
target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES})

7
libethereum/CMakeLists.txt

@ -18,11 +18,12 @@ endif()
file(GLOB HEADERS "*.h")
include_directories(..)
include_directories(${LEVELDB_ID})
target_link_libraries(${EXECUTABLE} ethcore)
target_link_libraries(${EXECUTABLE} secp256k1)
target_link_libraries(${EXECUTABLE} miniupnpc)
target_link_libraries(${EXECUTABLE} leveldb)
target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS})
target_link_libraries(${EXECUTABLE} ${LEVELDB_LS})
target_link_libraries(${EXECUTABLE} gmp)
@ -50,8 +51,6 @@ elseif (UNIX)
target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY})
target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY})
target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY})
target_link_libraries(${EXECUTABLE} leveldb)
# target_link_libraries(${EXECUTABLE} snappy)
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
else ()
target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES})

55
neth/CMakeLists.txt

@ -3,47 +3,50 @@ cmake_policy(SET CMP0015 NEW)
aux_source_directory(. SRC_LIST)
include_directories(..)
include_directories(${LEVELDB_ID})
link_directories(../libethcore)
link_directories(../libethereum)
set(EXECUTABLE neth)
add_executable(neth ${SRC_LIST})
add_executable(${EXECUTABLE} ${SRC_LIST})
if (${TARGET_PLATFORM} STREQUAL "w64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
target_link_libraries(neth gcc)
target_link_libraries(neth gdi32)
target_link_libraries(neth ws2_32)
target_link_libraries(neth mswsock)
target_link_libraries(neth shlwapi)
target_link_libraries(neth iphlpapi)
target_link_libraries(neth cryptopp)
target_link_libraries(neth ncurses)
target_link_libraries(neth form)
target_link_libraries(neth boost_system-mt-s)
target_link_libraries(neth boost_filesystem-mt-s)
target_link_libraries(neth boost_thread_win32-mt-s)
target_link_libraries(${EXECUTABLE} gcc)
target_link_libraries(${EXECUTABLE} gdi32)
target_link_libraries(${EXECUTABLE} ws2_32)
target_link_libraries(${EXECUTABLE} mswsock)
target_link_libraries(${EXECUTABLE} shlwapi)
target_link_libraries(${EXECUTABLE} iphlpapi)
target_link_libraries(${EXECUTABLE} cryptopp)
target_link_libraries(${EXECUTABLE} ncurses)
target_link_libraries(${EXECUTABLE} form)
target_link_libraries(${EXECUTABLE} boost_system-mt-s)
target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s)
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
elseif (UNIX)
target_link_libraries(neth ncurses)
target_link_libraries(neth form)
target_link_libraries(${EXECUTABLE} ncurses)
target_link_libraries(${EXECUTABLE} form)
else ()
target_link_libraries(neth ${CRYPTOPP_LIBRARIES})
target_link_libraries(neth boost_system)
target_link_libraries(neth boost_filesystem)
target_link_libraries(neth ncurses)
target_link_libraries(neth form)
target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES})
target_link_libraries(${EXECUTABLE} boost_system)
target_link_libraries(${EXECUTABLE} boost_filesystem)
target_link_libraries(${EXECUTABLE} ncurses)
target_link_libraries(${EXECUTABLE} form)
find_package(Threads REQUIRED)
target_link_libraries(neth ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include_directories(/usr/local/include)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(neth ethereum)
target_link_libraries(neth miniupnpc)
target_link_libraries(neth leveldb)
target_link_libraries(neth gmp)
target_link_libraries(${EXECUTABLE} ethereum)
target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS})
target_link_libraries(${EXECUTABLE} ${LEVELDB_LS})
target_link_libraries(${EXECUTABLE} gmp)
install( TARGETS neth DESTINATION bin )
install( TARGETS ${EXECUTABLE} DESTINATION bin )

Loading…
Cancel
Save