FIND_XXX.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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_ENVIRONMENT_PATH]
  15. [NO_CMAKE_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. The name of the |SEARCH_XXX| that
  31. is searched for is specified by the names listed
  32. after the NAMES argument. Additional search locations
  33. can be specified after the PATHS argument. If ENV var is
  34. found in the HINTS or PATHS section the environment variable var
  35. will be read and converted from a system environment variable to
  36. a cmake style list of paths. For example ENV PATH would be a way
  37. to list the system path variable. The argument
  38. after DOC will be used for the documentation string in
  39. the cache.
  40. PATH_SUFFIXES specifies additional subdirectories to check below
  41. each search path.
  42. If NO_DEFAULT_PATH is specified, then no additional paths are
  43. added to the search.
  44. If NO_DEFAULT_PATH is not specified, the search process is as follows:
  45. .. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
  46. <prefix>/|XXX_SUBDIR| for each <prefix> in CMAKE_PREFIX_PATH
  47. .. |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR| replace::
  48. <prefix>/|XXX_SUBDIR| for each <prefix>/[s]bin in PATH, and
  49. <entry>/|XXX_SUBDIR| for other entries in PATH
  50. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| replace::
  51. <prefix>/|XXX_SUBDIR| for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
  52. 1. Search paths specified in cmake-specific cache variables.
  53. These are intended to be used on the command line with a -DVAR=value.
  54. This can be skipped if NO_CMAKE_PATH is passed.
  55. * |CMAKE_PREFIX_PATH_XXX|
  56. * |CMAKE_XXX_PATH|
  57. * |CMAKE_XXX_MAC_PATH|
  58. 2. Search paths specified in cmake-specific environment variables.
  59. These are intended to be set in the user's shell configuration.
  60. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.
  61. * |CMAKE_PREFIX_PATH_XXX|
  62. * |CMAKE_XXX_PATH|
  63. * |CMAKE_XXX_MAC_PATH|
  64. 3. Search the paths specified by the HINTS option.
  65. These should be paths computed by system introspection, such as a
  66. hint provided by the location of another item already found.
  67. Hard-coded guesses should be specified with the PATHS option.
  68. 4. Search the standard system environment variables.
  69. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
  70. * |SYSTEM_ENVIRONMENT_PATH_XXX|
  71. 5. Search cmake variables defined in the Platform files
  72. for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH
  73. is passed.
  74. * |CMAKE_SYSTEM_PREFIX_PATH_XXX|
  75. * |CMAKE_SYSTEM_XXX_PATH|
  76. * |CMAKE_SYSTEM_XXX_MAC_PATH|
  77. 6. Search the paths specified by the PATHS option
  78. or in the short-hand version of the command.
  79. These are typically hard-coded guesses.
  80. .. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
  81. .. include:: FIND_XXX_MAC.txt
  82. .. include:: FIND_XXX_ROOT.txt
  83. .. include:: FIND_XXX_ORDER.txt