I'm compiling libdwarf on Windows. In its root CMakeLists.txt
, it attempts to find LibElf via:
find_package(LibElf REQUIRED)
LibElf doesn't use CMAKE and I haven't configured it to register itself in any way, so of course the find_package
fails. I'd like CMake to print out all the paths under which it is searching for LibElf at runtime. How do I tell CMake to output this? I've tried --trace
but that just show me the execution flow through my CMakeLists.txt
files--not the locations where CMake itself is presently looking for packages.
I know the documentation for find_package describes where CMake searches, but I can modify that behavior with all sorts of variables, environment variables, and registry settings. I'd like to see where exactly CMake is looking given all my modifications to those items I just mentioned.
I should note that libdwarf
includes a cmake/FindLibElf.cmake
module. Perhaps what I'm asking for isn't possible if FindLibElf.cmake
is free to do whatever it pleases?
Since version 3.17 CMake provides the option --debug-find
, which results in output of a ton of debug information about search process of find_package
and other find_*
commands:
cmake --debug-find <...>
The similar effect could be achieved by setting the variable CMAKE_FIND_DEBUG_MODE.
One may set the variable either in the command line:
cmake -DCMAKE_FIND_DEBUG_MODE=1 <...>
or in the CMakeLists.txt
:
set(CMAKE_FIND_DEBUG_MODE 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With