From b66820089b4823f82392b7a17aaf122d53e2b822 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sun, 10 Jul 2016 10:54:43 +0300 Subject: README: add notes about custom toolchainfile --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index a94de9c..374b63b 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,25 @@ $ cmake -DCMAKE_TOOLCHAIN_FILE=/output/host/usr/share/buildroot/t $ make -j4 ``` +Your environment may provide similar toolchainfile. If not, you can create a toolchainfile of your own, something along these lines: + +``` +SET(CMAKE_SYSTEM_NAME Linux) + +SET(BROOT "/output/") + +# specify the cross compiler +SET(CMAKE_C_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc) +SET(CMAKE_CXX_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-g++) + +# where is the target environment +SET(CMAKE_FIND_ROOT_PATH ${BROOT}/target ${BROOT}/host) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +``` + ## Build options You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them. -- cgit v1.2.3