Linked Questions

Popular Questions

Use libbitcoin in CLion

Asked by At

I am not a C++ programmer, only have made a course a while ago. Using homebrew I installed libbitcoin and was hoping that I can reference the library like I was able to reference the boost libraries. I also realized that there are no links in /usr/local/bin to the Cellar. I think I could get it working by using the absolute paths but I am looking for the proper way of handling this constellation that I just mentioned.

Current CMake:

cmake_minimum_required(VERSION 2.8.4)

project(cplusplus)

message(STATUS "start running cmake...")

find_package(boost 1.65.1 COMPONENTS system filesystem REQUIRED)
find_package(libbitcoin 3.3.0 COMPONENTS system filesystem REQUIRED)

message("system: ${CMAKE_SYSTEM_PREFIX_PATH}")
find_library(LIB_BITCOIN libbitcoin)
message("bitcoin: ${LIB_BITCOIN}")

if(Boost_FOUND)
    message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
    message(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")
    message(STATUS "Boost_VERSION: ${Boost_VERSION}")
    include_directories(${Boost_INCLUDE_DIRS})
 endif()

 add_executable(cplusplus main.cpp)

 if(Boost_FOUND)
     target_link_libraries(cplusplus ${Boost_LIBRARIES})
 endif()

Currently I get these errors:

/Applications/CLion.app/Contents/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/johndow/Documents/Workspace/bitcoin-code/cplusplus
-- start running cmake...
-- Boost version: 1.65.1
CMake Error at CMakeLists.txt:8 (find_package):
  By not providing "Findlibbitcoin.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "libbitcoin", but CMake did not find one.

  Could not find a package configuration file provided by "libbitcoin"
  (requested version 3.3.0) with any of the following names:

  libbitcoinConfig.cmake
  libbitcoin-config.cmake

  Add the installation prefix of "libbitcoin" to CMAKE_PREFIX_PATH or set
  "libbitcoin_DIR" to a directory containing one of the above files.  If
  "libbitcoin" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/Users/johndoe/Documents/Workspace/bitcoin-code/cplusplus/cmake-build-debug/CMakeFiles/CMakeOutput.log".

[Finished]

Related Questions