7/25/2023 0 Comments Cmake find packageThe CONFIG option, the synonymous NO_MODULE option, or the use of options not specified in the basic signature all enforce pure Config mode. The complete Config mode command signature is find_package( Project maintainers wishing to provide a package to be found by this command are encouraged to read on. The remainder of this command documentation specifies the full command signature and details of the search process. User code should generally look for packages using the above basic signature. A user may set the variable CMAKE_FIND_PACKAGE_PREFER_CONFIG to TRUE to direct CMake first search using Config mode before falling back to Module mode. Then, if the package is not found, it searches again using Config mode. If the MODULE option is not specified in the above signature, CMake first searches for the package using Module mode. Some find-modules provide limited or no support for versioning check the module documentation. It is responsible for finding the package, checking the version, and producing any needed messages. If the file is found, it is read and processed by CMake. The file is first searched in the CMAKE_MODULE_PATH, then among the Find Modules provided by the CMake installation. A version range with the format versionMin.[.cmake.A single version with the format major]].There are two possible forms in which it may be specified: The argument requests a version with which the package found should be compatible. Available components and their influence on whether a package is considered to be found are defined by the target package. Additional optional components may be listed after OPTIONAL_COMPONENTS. The REQUIRED option stops processing with an error message if the package cannot be found.Ī package-specific list of required components may be listed after the COMPONENTS option (or after the REQUIRED option if present). The QUIET option disables informational messages, including those indicating that the package cannot be found if it is not REQUIRED. When the package is found package-specific information is provided through variables and Imported Targets documented by the package itself. _FOUND will be set to indicate whether the package was found. ]įinds and loads settings from an external project. Basic Signature and Module Mode find_package( Find an external project, and load its settings.
0 Comments
Leave a Reply. |