Finding files, programs, and paths with CMake
Most projects quickly grow to a size and complexity where they depend on files, libraries, and perhaps even programs that are managed outside the project. CMake provides built-in commands to find these things. At first glance, the process of searching and finding things appears to be quite simple. However, on closer analysis, there are quite a few things to consider. First, we have to handle the search order of where to look for files. Then, we might want to add additional locations where the file might be, and finally, we have to account for the differences between different operating systems.
On an abstraction level higher than the individual files, CMake has the ability to find whole packages that define targets, include paths, and package specific variables. Refer to the libraries in your CMake project section for more detail.
There are five find_...
commands that share very similar options and behaviors:
find_file
:...