CMAKE_FIND_PACKAGE_WARN_NO_MODULE.rst 1012 B

12345678910111213141516171819
  1. CMAKE_FIND_PACKAGE_WARN_NO_MODULE
  2. ---------------------------------
  3. Tell :command:`find_package` to warn if called without an explicit mode.
  4. If :command:`find_package` is called without an explicit mode option
  5. (``MODULE``, ``CONFIG``, or ``NO_MODULE``) and no ``Find<pkg>.cmake`` module
  6. is in :variable:`CMAKE_MODULE_PATH` then CMake implicitly assumes that the
  7. caller intends to search for a package configuration file. If no package
  8. configuration file is found then the wording of the failure message
  9. must account for both the case that the package is really missing and
  10. the case that the project has a bug and failed to provide the intended
  11. Find module. If instead the caller specifies an explicit mode option
  12. then the failure message can be more specific.
  13. Set ``CMAKE_FIND_PACKAGE_WARN_NO_MODULE`` to ``TRUE`` to tell
  14. :command:`find_package` to warn when it implicitly assumes Config mode. This
  15. helps developers enforce use of an explicit mode in all calls to
  16. :command:`find_package` within a project.