If the package is not found, the search falls back to Config mode.Ī user may set the CMAKE_FIND_PACKAGE_PREFER_CONFIG variable When theīasic signature is used, the command searches in Module mode first. The command arguments determine which of the above modes is used. Heuristics are needed within the config or version files themselves.Ĭonfig mode is supported by both the basic and They usuallyĬontain direct knowledge of the package contents, so no searching or Package, so they tend to be more reliable than Find modules. The config and version files are typically installed as part of the Version files is considerably more complicated than for Module mode The locations where CMake searches for the config and In config mode, the command can be given a list of names to search forĪs package names. (see Config Mode Version Selection for an explanation of how these separate It will also look for -config-version.cmake orĬonfigVersion.cmake if version details were specified In this mode, CMake searches for a file called Libraries, files and other package artifacts. Provided, Find Modules tend to be heuristic in nature and are The package, such as the operating system, CMake itself, or even the projectįrom which the find_package() command was called. Rather, it is normally provided by something external to The Find.cmake file is not typically provided by the Some Find modules provide limited or no support for versioning It is responsibleįor finding the package, checking the version, and producing any needed If the file is found, it is read and processed by CMake. Then among the Find Modules provided by the CMake installation. Looking first in the locations listed in the CMAKE_MODULE_PATH, In this mode, CMake searches for a file called Find.cmake, The command has two very distinct ways of conducting the search: Module mode Find a package (usually provided by something external to the project),Īnd load its package-specific details.