From 6ed2d0d6c7c493e922a2871b9194688c93d5e479 Mon Sep 17 00:00:00 2001 From: "Bernardo A. Rodrigues" Date: Fri, 6 Mar 2020 15:45:56 +0100 Subject: [PATCH] doc CMake on README --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 2ee609d..7ba7d1f 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,17 @@ Pull-requests may be accepted to add or fix support for newer hardware, but new other changes will not be accepted. For support, comments, questions, etc please join the WiringPi Discord channel: https://discord.gg/SM4WUVG + +## CMake +You can use CMake to cross compile WiringPi. This is heavily inspired by Alex C. U.'s article [The Useful RaspberryPi Cross Compile Guide](https://medium.com/@au42/the-useful-raspberrypi-cross-compile-guide-ea56054de187). + +The main difference is that it assumes you are using [Embedded Development Infrastructure (edi)](https://docs.get-edi.io/en/latest/introduction.html). For more info, follow Matthias Lüscher’s [Cross Compiling for Raspbian Buster](https://www.get-edi.io/Cross-Compiling-for-Raspbian-Buster/) guide to set up an edi container. + +Do the following steps in a local clone of this repository inside a `raspbian-buster-cross` lxd container: +``` +$ mkdir build_cmake +$ cd build_cmake +$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/rpi.cmake +$ make +$ sudo make install +```