Chapter 12: Cross-Platform Compiling and Custom Toolchains
One of the powerful features of CMake is its support for the cross-platform building of software. Simply said, this means that with CMake, a project from any platform can be built for any other platform, as long as the necessary tools are available on the system running CMake. When building software, we typically talk about compilers and linkers, and they are of course essential tools for building software, but on a closer look, there are often some other tools, libraries, and files involved when building software. Collectively, these are commonly known as toolchains in CMake.
So far in this book, all the examples were built for the same system CMake was running on. In these cases, CMake usually does a pretty good job of finding the correct toolchain to use. However, if the software is to be built for another platform, the toolchain usually has to be specified by the developer. Toolchain definitions might be relatively...