You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

60 lines
1.9 KiB

cmake_policy(SET CMP0015 NEW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")
aux_source_directory(. SRC_LIST)
if(APPLE)
# set(CMAKE_INSTALL_PREFIX ../lib)
add_library(ethereum SHARED ${SRC_LIST})
else()
add_library(ethereum ${SRC_LIST})
endif()
file(GLOB HEADERS "*.h")
include_directories(../secp256k1)
target_link_libraries(ethereum secp256k1)
target_link_libraries(ethereum miniupnpc)
target_link_libraries(ethereum leveldb)
target_link_libraries(ethereum gmp)
if(${TARGET_PLATFORM} STREQUAL "w64")
include_directories(/usr/x86_64-w64-mingw32/include/cryptopp)
target_link_libraries(ethereum cryptopp)
target_link_libraries(ethereum boost_system-mt-s)
target_link_libraries(ethereum boost_filesystem-mt-s)
target_link_libraries(ethereum boost_thread_win32-mt-s)
target_link_libraries(ethereum iphlpapi)
target_link_libraries(ethereum ws2_32)
target_link_libraries(ethereum mswsock)
target_link_libraries(ethereum shlwapi)
elseif (APPLE)
# Latest mavericks boost libraries only come with -mt
target_link_libraries(ethereum ${CRYPTOPP_LIBRARIES})
target_link_libraries(ethereum boost_system-mt)
target_link_libraries(ethereum boost_filesystem-mt)
target_link_libraries(ethereum boost_thread-mt)
find_package(Threads REQUIRED)
target_link_libraries(ethereum ${CMAKE_THREAD_LIBS_INIT})
else ()
target_link_libraries(ethereum ${CRYPTOPP_LIBRARIES})
target_link_libraries(ethereum boost_system)
target_link_libraries(ethereum boost_filesystem)
target_link_libraries(ethereum boost_thread)
find_package(Threads REQUIRED)
target_link_libraries(ethereum ${CMAKE_THREAD_LIBS_INIT})
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
link_directories(/usr/local/lib)
include_directories(/usr/local/include)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
message("Installation path: ${CMAKE_INSTALL_PREFIX}")
install( TARGETS ethereum ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
install( FILES ${HEADERS} DESTINATION include/ethereum )