Summary
Broad support for cross-compiling is one of the striking features of CMake. In this chapter, we looked into how to define a toolchain file for cross-compiling and how to use sysroots to use libraries for a different target platform. A special case of cross-compiling is Android and Apple mobile devices, which rely on their specific SDKs. With a brief excursion into using emulators or simulators for testing for other platforms, you will have all the essential information to start building quality software for various target platforms.
The last part of the chapter concerned itself with the advanced topic of testing toolchains for certain features. While most projects will not have to concern themselves with these details, they are nevertheless useful to know.
The next chapter will be about making CMake code reusable across multiple projects without the need to rewrite all the things again and again.