--debug-find option gives extensive human-readable trace output for where the CMake find_* operations are looking for files.
In most CMake projects, there are many find_* operations, and so the
cmake --debug-find output can be overwhelming to scroll through.
A more controlled debug-find is available by targeting only specific find_* calls via CMAKE_FIND_DEBUG_MODE.
This example supposes the dev wishes to debug only the finding of LAPACK:
# arbitrary other packages that are not of interest to trace finding find_package(Git) # package that's not working right, to debug set(CMAKE_FIND_DEBUG_MODE on) find_package(LAPACK) set(CMAKE_FIND_DEBUG_MODE off)