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
This commit is contained in:
Ben Boeckel
2025-06-11 20:04:04 +02:00
parent 64f429cc4f
commit c42d82d569
31 changed files with 825 additions and 5 deletions
@@ -0,0 +1,26 @@
CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG
-----------------------------------------------
.. versionadded:: 4.1
The following commands will report configure log events when they experience a
transition between found and not-found states or when the result is first
defined:
* :command:`find_program`
* :command:`find_library`
* :command:`find_file`
* :command:`find_path`
* :command:`find_package`
The ``CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG`` boolean variable
suppresses these implicit events from the configure log when set to a true
value.
.. code-block:: cmake
set(CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG TRUE)
find_program(...)
set(CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG FALSE)
Default is unset.