diff options
author | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2016-07-10 10:54:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-10 10:54:43 +0300 |
commit | b66820089b4823f82392b7a17aaf122d53e2b822 (patch) | |
tree | f89d62ffc937dd4d27a4f58c07e93e3ee255e897 | |
parent | 32211ba92d5ded0174b4d4f19a7eb66183f5a6c9 (diff) |
README: add notes about custom toolchainfile
-rw-r--r-- | README.md | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -47,6 +47,25 @@ $ cmake -DCMAKE_TOOLCHAIN_FILE=<buildrootpath>/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 "<buildroot>/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. |