mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 22:30:13 -06:00
Teach the find_package, find_library, find_program, find_path, and find_file commands to print debug log messages when enabled by the `--debug-find` command-line option or `CMAKE_FIND_DEBUG_MODE` variable.
15 lines
513 B
CMake
15 lines
513 B
CMake
set(ENV_PATH "$ENV{PATH}")
|
|
|
|
set(CMAKE_FIND_DEBUG_MODE 1)
|
|
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/bin")
|
|
find_file(PrefixInPATH_INCLUDE_DIR NAMES PrefixInPATH.h)
|
|
set(CMAKE_FIND_DEBUG_MODE 0)
|
|
|
|
foreach(path "/does_not_exist" "" "/bin" "/sbin")
|
|
unset(PrefixInPATH_INCLUDE_DIR CACHE)
|
|
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
|
|
find_file(PrefixInPATH_INCLUDE_DIR NAMES PrefixInPATH.h)
|
|
message(STATUS "PrefixInPATH_INCLUDE_DIR='${PrefixInPATH_INCLUDE_DIR}'")
|
|
endforeach()
|
|
set(ENV{PATH} "${ENV_PATH}")
|