Clone glassechidna's zxing-cpp fork.
In CMakeLists.txt
, add include(toolchain.cmake)
as the first line.
Create a new file, toolchain.cmake
:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
Make a build directory, run cmake
, and build with make
:
mkdir build
cd build
cmake -g "Unix Makefiles" ../
make -j10
Also can explore nu-book's more recently maintained fork.