FindDev.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #------------------------------------------------------------------------------
  2. # CMake helper for libdevcore, libdevcrypto and libp2p modules.
  3. #
  4. # This module defines
  5. # Dev_XXX_LIBRARIES, the libraries needed to use ethereum.
  6. # Dev_INCLUDE_DIRS
  7. #
  8. # The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
  9. #
  10. # ------------------------------------------------------------------------------
  11. # This file is part of cpp-ethereum.
  12. #
  13. # cpp-ethereum is free software: you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation, either version 3 of the License, or
  16. # (at your option) any later version.
  17. #
  18. # cpp-ethereum is distributed in the hope that it will be useful,
  19. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. # GNU General Public License for more details.
  22. #
  23. # You should have received a copy of the GNU General Public License
  24. # along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>
  25. #
  26. # (c) 2014-2016 cpp-ethereum contributors.
  27. #------------------------------------------------------------------------------
  28. include(EthUtils)
  29. set(LIBS devcore;devcrypto;p2p)
  30. set(Dev_INCLUDE_DIRS "${CPP_ETHEREUM_DIR}")
  31. # if the project is a subset of main cpp-ethereum project
  32. # use same pattern for variables as Boost uses
  33. if ((DEFINED cpp-ethereum_VERSION) OR (DEFINED dev_VERSION))
  34. foreach (l ${LIBS})
  35. string(TOUPPER ${l} L)
  36. set ("Dev_${L}_LIBRARIES" ${l})
  37. endforeach()
  38. else()
  39. foreach (l ${LIBS})
  40. string(TOUPPER ${l} L)
  41. find_library(Dev_${L}_LIBRARY
  42. NAMES ${l}
  43. PATHS ${CMAKE_LIBRARY_PATH}
  44. PATH_SUFFIXES "lib${l}" "${l}" "lib${l}/Debug" "lib${l}/Release"
  45. NO_DEFAULT_PATH
  46. )
  47. set(Dev_${L}_LIBRARIES ${Dev_${L}_LIBRARY})
  48. if (MSVC)
  49. find_library(Dev_${L}_LIBRARY_DEBUG
  50. NAMES ${l}
  51. PATHS ${CMAKE_LIBRARY_PATH}
  52. PATH_SUFFIXES "lib${l}/Debug"
  53. NO_DEFAULT_PATH
  54. )
  55. eth_check_library_link(Dev_${L})
  56. endif()
  57. endforeach()
  58. endif()