<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
1. Toolchain needs to be in a separate file<br></blockquote><div><br></div><div>Yes, that is certainly best practice and makes the rest of the cross-compiling infrastructure just work better.<br><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2.  That file needs to be called before the project line of your CMakeLists.txt<br></blockquote><div><br></div><div>You actually shouldn't be "calling" it at all.  You specify it with cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/MyARMStuff.cmake ...[other cmake options] /path/to/source.  CMake then explicitly processes the toolchain file in a few different places but handles when to do this internally.  Basically you write your CMakeLists.txt without worrying much about cross-compiling and you specify the toolcain file to let CMake deal with the cross-compile aspect.<br></div></div><br><br></div></div>