cmake/Help/variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE.rst

23 lines
1.1 KiB
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
CMAKE_FIND_PACKAGE_WARN_NO_MODULE
---------------------------------
2015-11-17 17:22:37 +01:00
Tell :command:`find_package` to warn if called without an explicit mode.
2014-08-03 19:52:23 +02:00
2015-11-17 17:22:37 +01:00
If :command:`find_package` is called without an explicit mode option
(``MODULE``, ``CONFIG``, or ``NO_MODULE``) and no ``Find<pkg>.cmake`` module
is in :variable:`CMAKE_MODULE_PATH` then CMake implicitly assumes that the
caller intends to search for a package configuration file. If no package
2014-08-03 19:52:23 +02:00
configuration file is found then the wording of the failure message
must account for both the case that the package is really missing and
the case that the project has a bug and failed to provide the intended
Find module. If instead the caller specifies an explicit mode option
then the failure message can be more specific.
2015-11-17 17:22:37 +01:00
Set ``CMAKE_FIND_PACKAGE_WARN_NO_MODULE`` to ``TRUE`` to tell
:command:`find_package` to warn when it implicitly assumes Config mode. This
helps developers enforce use of an explicit mode in all calls to
:command:`find_package` within a project.
2019-11-11 23:01:05 +01:00
This variable has no effect if :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` is
set to ``TRUE``.