CMAKE_SYSTEM_PREFIX_PATH.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. CMAKE_SYSTEM_PREFIX_PATH
  2. ------------------------
  3. :ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying installation
  4. *prefixes* to be searched by the :command:`find_package`,
  5. :command:`find_program`, :command:`find_library`, :command:`find_file`, and
  6. :command:`find_path` commands. Each command will add appropriate
  7. subdirectories (like ``bin``, ``lib``, or ``include``) as specified in its own
  8. documentation.
  9. By default this contains the system directories for the current system, the
  10. :variable:`CMAKE_INSTALL_PREFIX`, and the :variable:`CMAKE_STAGING_PREFIX`.
  11. The installation and staging prefixes may be excluded by setting
  12. the :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` variable before the
  13. first :command:`project` invocation.
  14. The system directories that are contained in ``CMAKE_SYSTEM_PREFIX_PATH`` are
  15. locations that typically include installed software. An example being
  16. ``/usr/local`` for UNIX based platforms. In addition to standard platform
  17. locations, CMake will also add values to ``CMAKE_SYSTEM_PREFIX_PATH`` based on
  18. environment variables. The environment variables and search locations that
  19. CMake uses may evolve over time, as platforms and their conventions also
  20. evolve. The following provides an indicative list of environment variables
  21. and locations that CMake searches, but they are subject to change:
  22. CrayLinuxEnvironment:
  23. * ``ENV{SYSROOT_DIR}/``
  24. * ``ENV{SYSROOT_DIR}/usr``
  25. * ``ENV{SYSROOT_DIR}/usr/local``
  26. Darwin:
  27. * ``ENV{SDKROOT}/usr`` When ``CMAKE_OSX_SYSROOT`` is not explicitly specified.
  28. OpenBSD:
  29. * ``ENV{LOCALBASE}``
  30. Unix:
  31. * ``ENV{CONDA_PREFIX}`` when using a conda compiler
  32. Windows:
  33. * ``ENV{ProgramW6432}``
  34. * ``ENV{ProgramFiles}``
  35. * ``ENV{ProgramFiles(x86)}``
  36. * ``ENV{SystemDrive}/Program Files``
  37. * ``ENV{SystemDrive}/Program Files (x86)``
  38. ``CMAKE_SYSTEM_PREFIX_PATH`` is *not* intended to be modified by the project;
  39. use :variable:`CMAKE_PREFIX_PATH` for this.
  40. See also :variable:`CMAKE_SYSTEM_INCLUDE_PATH`,
  41. :variable:`CMAKE_SYSTEM_LIBRARY_PATH`, :variable:`CMAKE_SYSTEM_PROGRAM_PATH`,
  42. and :variable:`CMAKE_SYSTEM_IGNORE_PATH`.