find_*(): Add CMAKE_IGNORE_PREFIX_PATH variable

Fixes: #20878
This commit is contained in:
Kyle Edwards
2022-01-26 16:35:54 -05:00
parent bd805a51ae
commit 201d8c4298
16 changed files with 165 additions and 12 deletions
@@ -0,0 +1,17 @@
CMAKE_IGNORE_PREFIX_PATH
------------------------
:ref:`Semicolon-separated list <CMake Language Lists>` of prefix to be *ignored* by
the :command:`find_program`, :command:`find_library`, :command:`find_file`,
:command:`find_path`, and :command:`find_package` commands. This is useful in cross-compiling
environments where some system directories contain incompatible but
possibly linkable libraries. For example, on cross-compiled cluster
environments, this allows a user to ignore directories containing
libraries meant for the front-end machine.
By default this is empty; it is intended to be set by the project.
Note that ``CMAKE_IGNORE_PREFIX_PATH`` takes a list of prefixes, *not*
a list of directory names.
See also the :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_LIBRARY_PATH`,
:variable:`CMAKE_INCLUDE_PATH`, and :variable:`CMAKE_PROGRAM_PATH` variables.
@@ -0,0 +1,18 @@
CMAKE_SYSTEM_IGNORE_PREFIX_PATH
-------------------------------
:ref:`Semicolon-separated list <CMake Language Lists>` of prefixes to be *ignored* by
the :command:`find_program`, :command:`find_library`, :command:`find_file`,
:command:`find_path`, and :command:`find_package` commands. This is useful in cross-compiling
environments where some system directories contain incompatible but
possibly linkable libraries. For example, on cross-compiled cluster
environments, this allows a user to ignore directories containing
libraries meant for the front-end machine.
By default this contains a list of directories containing incompatible
binaries for the host system. See the :variable:`CMAKE_IGNORE_PREFIX_PATH` variable
that is intended to be set by the project.
See also the :variable:`CMAKE_SYSTEM_PREFIX_PATH`,
:variable:`CMAKE_SYSTEM_LIBRARY_PATH`, :variable:`CMAKE_SYSTEM_INCLUDE_PATH`,
and :variable:`CMAKE_SYSTEM_PROGRAM_PATH` variables.