[CMake] Correct way to use ARMCC (Files in Modules/Compiler/ARMCC*)
Chuck Atkins
chuck.atkins at kitware.com
Fri Sep 30 15:09:43 EDT 2016
>
> 1. Toolchain needs to be in a separate file
>
Yes, that is certainly best practice and makes the rest of the
cross-compiling infrastructure just work better.
> 2. That file needs to be called before the project line of your
> CMakeLists.txt
>
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160930/42c589a4/attachment.html>
More information about the CMake
mailing list