Issue
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
Solution
Commands to do (as @kyb said) and according to instruction:
- Installing dependencies:
apt-get update; \
apt-get -y --no-install-recommends install \
build-essential ninja-build \
git ca-certificates tar curl unzip cmake
- Clonning iroha:
git clone https://github.com/hyperledger/iroha.git
- 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
- 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"
- Last step would be run ninja:
cmake --build . --target irohad -- -j<number of threads>
- Optionally You can install the binaries:
cmake --install . --target irohad
Answered By - baziorek