DESTDIR.rst 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. DESTDIR
  2. -------
  3. .. include:: include/ENV_VAR.rst
  4. On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
  5. whole installation. ``DESTDIR`` means DESTination DIRectory. It is
  6. commonly used by packagers to install software in a staging directory.
  7. For example, running
  8. .. code-block:: shell
  9. make DESTDIR=/package/stage install
  10. will install the software using the installation prefix, e.g. ``/usr/local``,
  11. prepended with the ``DESTDIR`` value which gives ``/package/stage/usr/local``.
  12. The packaging tool may then construct the package from the content of the
  13. ``/package/stage`` directory.
  14. See the :variable:`CMAKE_INSTALL_PREFIX` variable to control the
  15. installation prefix when configuring a build tree. Or, when using
  16. the :manual:`cmake(1)` command-line tool's :option:`--install <cmake --install>`
  17. mode, one may specify a different prefix using the
  18. :option:`--prefix <cmake--install --prefix>` option.
  19. .. note::
  20. ``DESTDIR`` may not be used on Windows because installation
  21. prefix usually contains a drive letter like in ``C:/Program Files``
  22. which cannot be prepended with some other prefix.