FIND_XXX_ROOT.txt 1.4 KB

1234567891011121314151617181920212223242526272829
  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 using options:
  18. ``CMAKE_FIND_ROOT_PATH_BOTH``
  19. Search in the order described above.
  20. ``NO_CMAKE_FIND_ROOT_PATH``
  21. Do not use the :variable:`CMAKE_FIND_ROOT_PATH` variable.
  22. ``ONLY_CMAKE_FIND_ROOT_PATH``
  23. Search only the re-rooted directories and directories below
  24. :variable:`CMAKE_STAGING_PREFIX`.