0

I try to build Iroha Hyperledger using Doker. after I clone the image and try to execute the build with CMake

cmake -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE=/opt/dependencies/scripts/buildsystems/vcpkg.cmake -G "Ninja"

I got this error:

Could not find toolchain file:
  /opt/dependencies/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  CMakeLists.txt:12 (PROJECT)

I use CMake 3.16

Any help

Jaysmito Mukherjee
  • 1,467
  • 2
  • 10
  • 29
  • 1
    Error message "could not find toolchain file" seems to be self-explanatory: CMake cannot find the file which you specify with `-DCMAKE_TOOLCHAIN_FILE` option. – Tsyvarev Jan 19 '21 at 13:33

2 Answers2

2

You should build vcpkg and install vcpkg packages before building iroha. Please refer the docs.

kyb
  • 7,233
  • 5
  • 52
  • 105
1

Commands to do (as @kyb said) and according to instruction:

  1. Installing dependencies:
apt-get update; \
apt-get -y --no-install-recommends install \
build-essential ninja-build \
git ca-certificates tar curl unzip cmake
  1. Clonning iroha:
git clone https://github.com/hyperledger/iroha.git
  1. Building dependencies:
iroha/vcpkg/build_iroha_deps.sh
vcpkg/vcpkg integrate install

As a result You will see command like:

-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
  1. Finally You need to add the command to the CMake command (as You provided):
cmake -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE=/opt/dependencies/scripts/buildsystems/vcpkg.cmake -G "Ninja"
  1. Last step would be run ninja:
cmake --build . --target irohad -- -j<number of threads>
  1. Optionally You can install the binaries:
cmake --install . --target irohad
baziorek
  • 2,502
  • 2
  • 29
  • 43