FIND_XXX.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. A short-hand signature is:
  2. .. parsed-literal::
  3. |FIND_XXX| (<VAR> name1 [path1 path2 ...])
  4. The general signature is:
  5. .. parsed-literal::
  6. |FIND_XXX| (
  7. <VAR>
  8. name | |NAMES|
  9. [HINTS path1 [path2 ... ENV var]]
  10. [PATHS path1 [path2 ... ENV var]]
  11. [PATH_SUFFIXES suffix1 [suffix2 ...]]
  12. [DOC "cache documentation string"]
  13. [NO_DEFAULT_PATH]
  14. [NO_CMAKE_PATH]
  15. [NO_CMAKE_ENVIRONMENT_PATH]
  16. [NO_SYSTEM_ENVIRONMENT_PATH]
  17. [NO_CMAKE_SYSTEM_PATH]
  18. [CMAKE_FIND_ROOT_PATH_BOTH |
  19. ONLY_CMAKE_FIND_ROOT_PATH |
  20. NO_CMAKE_FIND_ROOT_PATH]
  21. )
  22. This command is used to find a |SEARCH_XXX_DESC|.
  23. A cache entry named by ``<VAR>`` is created to store the result
  24. of this command.
  25. If the |SEARCH_XXX| is found the result is stored in the variable
  26. and the search will not be repeated unless the variable is cleared.
  27. If nothing is found, the result will be
  28. ``<VAR>-NOTFOUND``, and the search will be attempted again the
  29. next time |FIND_XXX| is invoked with the same variable.
  30. Options include:
  31. ``NAMES``
  32. Specify one or more possible names for the |SEARCH_XXX|.
  33. When using this to specify names with and without a version
  34. suffix, we recommend specifying the unversioned name first
  35. so that locally-built packages can be found before those
  36. provided by distributions.
  37. ``HINTS``, ``PATHS``
  38. Specify directories to search in addition to the default locations.
  39. The ``ENV var`` sub-option reads paths from a system environment
  40. variable.
  41. ``PATH_SUFFIXES``
  42. Specify additional subdirectories to check below each directory
  43. location otherwise considered.
  44. ``DOC``
  45. Specify the documentation string for the ``<VAR>`` cache entry.
  46. If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
  47. added to the search.
  48. If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
  49. .. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
  50. |prefix_XXX_SUBDIR| for each ``<prefix>`` in :variable:`CMAKE_PREFIX_PATH`
  51. .. |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR| replace::
  52. |prefix_XXX_SUBDIR| for each ``<prefix>/[s]bin`` in ``PATH``, and
  53. |entry_XXX_SUBDIR| for other entries in ``PATH``
  54. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| replace::
  55. |prefix_XXX_SUBDIR| for each ``<prefix>`` in
  56. :variable:`CMAKE_SYSTEM_PREFIX_PATH`
  57. 1. Search paths specified in cmake-specific cache variables.
  58. These are intended to be used on the command line with a ``-DVAR=value``.
  59. The values are interpreted as :ref:`;-lists <CMake Language Lists>`.
  60. This can be skipped if ``NO_CMAKE_PATH`` is passed.
  61. * |CMAKE_PREFIX_PATH_XXX|
  62. * |CMAKE_XXX_PATH|
  63. * |CMAKE_XXX_MAC_PATH|
  64. 2. Search paths specified in cmake-specific environment variables.
  65. These are intended to be set in the user's shell configuration,
  66. and therefore use the host's native path separator
  67. (``;`` on Windows and ``:`` on UNIX).
  68. This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed.
  69. * |CMAKE_PREFIX_PATH_XXX|
  70. * |CMAKE_XXX_PATH|
  71. * |CMAKE_XXX_MAC_PATH|
  72. 3. Search the paths specified by the ``HINTS`` option.
  73. These should be paths computed by system introspection, such as a
  74. hint provided by the location of another item already found.
  75. Hard-coded guesses should be specified with the ``PATHS`` option.
  76. 4. Search the standard system environment variables.
  77. This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is an argument.
  78. * |SYSTEM_ENVIRONMENT_PATH_XXX|
  79. 5. Search cmake variables defined in the Platform files
  80. for the current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH``
  81. is passed.
  82. * |CMAKE_SYSTEM_PREFIX_PATH_XXX|
  83. * |CMAKE_SYSTEM_XXX_PATH|
  84. * |CMAKE_SYSTEM_XXX_MAC_PATH|
  85. 6. Search the paths specified by the PATHS option
  86. or in the short-hand version of the command.
  87. These are typically hard-coded guesses.
  88. .. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
  89. On OS X the :variable:`CMAKE_FIND_FRAMEWORK` and
  90. :variable:`CMAKE_FIND_APPBUNDLE` variables determine the order of
  91. preference between Apple-style and unix-style package components.
  92. .. include:: FIND_XXX_ROOT.txt
  93. .. include:: FIND_XXX_ORDER.txt