FIND_XXX_ROOT.txt 1.4 KB

1234567891011121314151617181920212223
  1. The CMake variable :variable:`CMAKE_FIND_ROOT_PATH` specifies one or more
  2. directories to be prepended to all other search directories. This
  3. effectively "re-roots" the entire search under given locations.
  4. Paths which are descendants of the :variable:`CMAKE_STAGING_PREFIX` are excluded
  5. from this re-rooting, because that variable is always a path on the host system.
  6. By default the :variable:`CMAKE_FIND_ROOT_PATH` is empty.
  7. The :variable:`CMAKE_SYSROOT` variable can also be used to specify exactly one
  8. directory to use as a prefix. Setting :variable:`CMAKE_SYSROOT` also has other
  9. effects. See the documentation for that variable for more.
  10. These variables are especially useful when cross-compiling to
  11. point to the root directory of the target environment and CMake will
  12. search there too. By default at first the directories listed in
  13. :variable:`CMAKE_FIND_ROOT_PATH` are searched, then the :variable:`CMAKE_SYSROOT`
  14. directory is searched, and then the non-rooted directories will be
  15. searched. The default behavior can be adjusted by setting
  16. |CMAKE_FIND_ROOT_PATH_MODE_XXX|. This behavior can be manually
  17. overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH
  18. the search order will be as described above. If
  19. NO_CMAKE_FIND_ROOT_PATH is used then :variable:`CMAKE_FIND_ROOT_PATH` will not be
  20. used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted
  21. directories and directories below :variable:`CMAKE_STAGING_PREFIX` will be searched.