Cross-Platform-Compiling Custom Toolchains
One of the powerful features of CMake is its support for the cross-platform building of software. Simply put, this means that with CMake, a project from any platform can be built for any other platform, if 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. However, if we take 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 system that 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 built for another platform, the toolchain usually must be specified by the developer. Toolchain definitions might be relatively straightforward and...