CMAKE_INSTALL_PREFIX.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. CMAKE_INSTALL_PREFIX
  2. --------------------
  3. Install directory used by :command:`install`.
  4. If ``make install`` is invoked or ``INSTALL`` is built, this directory is
  5. prepended onto all install directories. This variable defaults to
  6. ``/usr/local`` on UNIX and ``c:/Program Files/${PROJECT_NAME}`` on Windows.
  7. See :variable:`CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT` for how a
  8. project might choose its own default.
  9. On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
  10. whole installation to a staging area. See the :envvar:`DESTDIR` environment
  11. variable for more information.
  12. The installation prefix is also added to :variable:`CMAKE_SYSTEM_PREFIX_PATH`
  13. so that :command:`find_package`, :command:`find_program`,
  14. :command:`find_library`, :command:`find_path`, and :command:`find_file`
  15. will search the prefix for other software. This behavior can be disabled by
  16. setting the :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` to ``TRUE`` before the
  17. first :command:`project` invocation.
  18. .. note::
  19. Use the :module:`GNUInstallDirs` module to provide GNU-style
  20. options for the layout of directories within the installation.
  21. The ``CMAKE_INSTALL_PREFIX`` may be defined when configuring a build tree
  22. to set its installation prefix. Or, when using the :manual:`cmake(1)`
  23. command-line tool's :option:`--install <cmake --install>` mode, one may
  24. specify a different prefix using the :option:`--prefix <cmake --prefix>`
  25. option:
  26. .. code-block:: shell
  27. cmake --install . --prefix /my/install/prefix