CMakeLists.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #------------------------------------------------------------------------------
  2. # Top-level CMake file for cpp-ethereum.
  3. #
  4. # The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
  5. #
  6. # ------------------------------------------------------------------------------
  7. # This file is part of cpp-ethereum.
  8. #
  9. # cpp-ethereum is free software: you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation, either version 3 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # cpp-ethereum is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>
  21. #
  22. # (c) 2014-2016 cpp-ethereum contributors.
  23. #------------------------------------------------------------------------------
  24. cmake_minimum_required(VERSION 3.0.0)
  25. set(ETH_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The path to the cmake directory")
  26. list(APPEND CMAKE_MODULE_PATH ${ETH_CMAKE_DIR})
  27. set(CPP_ETHEREUM_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Path to the root directory for cpp-ethereum")
  28. # set cmake_policies
  29. include(EthPolicy)
  30. eth_policy()
  31. # project name and version should be set after cmake_policy CMP0048
  32. project(cpp-ethereum VERSION "1.3.0")
  33. include(EthCompilerSettings)
  34. include(EthExecutableHelper)
  35. include(EthDependencies)
  36. include(EthUtils)
  37. include(EthOptions)
  38. find_package(PkgConfig REQUIRED)
  39. pkg_check_modules(JSONCPP jsoncpp)
  40. message("json libraries:" ${JSONCPP_LIBRARIES})
  41. link_libraries(${JSONCPP_LIBRARIES})
  42. # target_link_libraries(cpp-ethereum ${JSONCPP_LIBRARIES})
  43. if(JSONCPP_FOUND)
  44. message("INFO: we found LibJsoncpp on your pc.")
  45. message(Jsoncpp_FOUND = ${JSONCPP_FOUND})
  46. message(Jsoncpp_INCLUDE_DIR = ${JSONCPP_INCLUDE_DIR})
  47. message(Jsoncpp_INCLUDE_DIRS = ${JSONCPP_INCLUDE_DIRS})
  48. message(Jsoncpp_LIBRARY = ${JSONCPP_LIBRARY})
  49. else(JSONCPP_FOUND)
  50. message("ERROR: we couldn't find LibJsoncpp on your pc")
  51. endif(JSONCPP_FOUND)
  52. include(deps/jsonrpc.cmake)
  53. include(cmake/Findjson_rpc_cpp.cmake)
  54. message( "JSON_RCP_CPP_INCLUDE_DIRS:" ${JSON_RCP_CPP_INCLUDE_DIRS})
  55. message( "JSON_RCP_CPP_LIBRARIES:" ${JSON_RCP_CPP_LIBRARIES})
  56. message( "JSON_RPC_CPP_SERVER_LIBRARIES:" ${JSON_RPC_CPP_SERVER_LIBRARIES})
  57. message( "JSON_RPC_CPP_CLIENT_LIBRARIES:" ${JSON_RPC_CPP_CLIENT_LIBRARIES})
  58. message( "JSON_RCP_CPP_FOUND:" ${JSON_RCP_CPP_FOUND})
  59. message( "JSON_RPC_CPP_VERSION:" ${JSON_RPC_CPP_VERSION})
  60. message( "JSON_RPC_CPP_VERSION_MAJOR:" ${JSON_RPC_CPP_VERSION_MAJOR})
  61. message( "JSON_RPC_CPP_VERSION_MINOR:" ${JSON_RPC_CPP_VERSION_MINOR})
  62. message( "JSON_RPC_CPP_VERSION_PATCH:" ${JSON_RPC_CPP_VERSION_PATCH})
  63. configure_project(CPUID CURL ETHASHCL EVMJIT FATDB MINIUPNPC ROCKSDB PARANOID TESTS VMTRACE)
  64. add_subdirectory(eth)
  65. add_subdirectory(libdevcore)
  66. add_subdirectory(libdevcrypto)
  67. add_subdirectory(libethash)
  68. add_subdirectory(libethashseal)
  69. add_subdirectory(libethcore)
  70. add_subdirectory(libethereum)
  71. add_subdirectory(libevm)
  72. add_subdirectory(libevmcore)
  73. if (NOT EMSCRIPTEN)
  74. add_subdirectory(libp2p)
  75. endif()
  76. add_subdirectory(libweb3jsonrpc)
  77. add_subdirectory(libwebthree)
  78. add_subdirectory(libwhisper)
  79. if (ETHASHCL)
  80. add_subdirectory(libethash-cl)
  81. endif()
  82. if (EVMJIT)
  83. message("we're doing EVMJIT")
  84. include(deps/evmjit.cmake)
  85. if(EVMJIT_FOUND)
  86. message("and we found EVMJIT!")
  87. endif()
  88. endif()
  89. if (TOOLS)
  90. add_subdirectory(ethkey)
  91. add_subdirectory(ethminer)
  92. add_subdirectory(ethvm)
  93. if (NOT EMSCRIPTEN)
  94. add_subdirectory(rlp)
  95. add_subdirectory(bench)
  96. endif()
  97. endif()
  98. if (TESTS)
  99. add_subdirectory(test)
  100. endif()
  101. # TODO - split out json_spirit, libscrypt and sec256k1
  102. add_subdirectory(utils)
  103. #add_compile_options(-pthreads)
  104. #find_package(Threads)