Files
CMake/Tests/RunCMake/find_path/ConfigureLogTransitionsSuppressed.cmake
Ben Boeckel c42d82d569 find_*: support suppressing implicit transition events
When projects explicitly unset variables, the transition detection can
end up reporting events when they are not desired.

See: #24833
2025-06-11 20:09:32 +02:00

25 lines
754 B
CMake

set(CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG 1)
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
message(CONFIGURE_LOG "NotDefined -> NotFound")
find_path(NOEXIST_FILE NAMES NoExist.h)
message(CONFIGURE_LOG "NotFound -> NotFound")
find_path(NOEXIST_FILE NAMES NoExist.h)
message(CONFIGURE_LOG "NotDefined -> Found")
find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h)
message(CONFIGURE_LOG "Found -> Found")
find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h)
message(CONFIGURE_LOG "Found -> NotFound")
unset(PREFIX_IN_PATH CACHE)
unset(CMAKE_PREFIX_PATH)
find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h)
message(CONFIGURE_LOG "NotFound -> Found")
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
find_path(PREFIX_IN_PATH NAMES PrefixInPATH.h)