Find-modules typically follow a specific pattern:
- Check whether the user provided a custom location for the desired package.
- Use commands from the find_ family to search for known required components of the required package, that is, header files, libraries, executables, and so forth. We have used find_path to find the full path to a header file and find_library to find a library. CMake also offers find_file, find_program, and find_package. These commands have the following general signature:
find_path(<VAR> NAMES name PATHS paths)
- Here, <VAR> will hold the result of the search, if successful, or <VAR>-NOTFOUND if unsuccessful. NAMES and PATHS are names for the file CMake should look for and paths where the search should be ...