CMakeLists.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. find_package(PkgConfig REQUIRED)
  2. pkg_check_modules(JSONCPP jsoncpp)
  3. message("json libraries:" ${JSONCPP_LIBRARIES})
  4. link_libraries(${JSONCPP_LIBRARIES})
  5. # target_link_libraries(cpp-ethereum ${JSONCPP_LIBRARIES})
  6. if(JSONCPP_FOUND)
  7. message("INFO: we found LibJsoncpp on your pc.")
  8. message(Jsoncpp_FOUND = ${JSONCPP_FOUND})
  9. message(Jsoncpp_INCLUDE_DIR = ${JSONCPP_INCLUDE_DIR})
  10. message(Jsoncpp_INCLUDE_DIRS = ${JSONCPP_INCLUDE_DIRS})
  11. message(Jsoncpp_LIBRARY = ${JSONCPP_LIBRARY})
  12. else(JSONCPP_FOUND)
  13. message("ERROR: we couldn't find LibJsoncpp on your pc")
  14. endif(JSONCPP_FOUND)
  15. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")
  16. aux_source_directory(. SRC_LIST)
  17. file(GLOB HEADERS "*.h")
  18. add_library(ethereum ${SRC_LIST} ${HEADERS})
  19. target_link_libraries(ethereum ${Boost_REGEX_LIBRARIES} ${JSONCPP_LIBRARIES})
  20. find_package(Boost QUIET REQUIRED COMPONENTS regex)
  21. find_package(Dev)
  22. find_package(Eth)
  23. target_include_directories(ethereum PRIVATE ..)
  24. target_include_directories(ethereum PRIVATE ../utils)
  25. target_link_libraries(ethereum ${Boost_REGEX_LIBRARIES})
  26. target_link_libraries(ethereum ${Eth_ETHCORE_LIBRARIES})
  27. target_link_libraries(ethereum ${Eth_EVM_LIBRARIES})
  28. if (NOT EMSCRIPTEN)
  29. target_link_libraries(ethereum ${Dev_P2P_LIBRARIES})
  30. target_link_libraries(ethereum ${Dev_DEVCRYPTO_LIBRARIES})
  31. endif()
  32. if (EVMJIT)
  33. target_link_libraries(ethereum ${Eth_EVMJIT_LIBRARIES})
  34. endif()
  35. install(TARGETS ethereum RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)